aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Path.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-09-11 04:06:52 +0000
committerGitHub <noreply@github.com>2026-09-11 01:06:52 -0300
commitb79224410f469a1cd4ff3be4f8e62d71398109fc (patch)
treee025feebbdf9703ce790b4a97cb9997242c9bb4b /lib/kernel/Path.ml
parentefe8032f7e224c29fc67a4f8cfd52db908442eec (diff)
downloadRNT-b79224410f469a1cd4ff3be4f8e62d71398109fc.tar.gz
RNT-b79224410f469a1cd4ff3be4f8e62d71398109fc.zip
Multigroup objects
Diffstat (limited to 'lib/kernel/Path.ml')
-rw-r--r--lib/kernel/Path.ml17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/kernel/Path.ml b/lib/kernel/Path.ml
new file mode 100644
index 0000000..803d8cf
--- /dev/null
+++ b/lib/kernel/Path.ml
@@ -0,0 +1,17 @@
+type t = string list
+
+let this = []
+let (@/) x y = x::y
+
+let rec lookup handle = function
+ | [] -> Ok (Some handle)
+ | x::xs ->
+ let open Utilities.Result in
+ let open Protocols in
+ match Protocols.Directory.from handle with
+ | None -> Ok None
+ | Some dir ->
+ let* elem = Directory.find dir x in
+ match elem with
+ | None -> Ok None
+ | Some elem -> lookup elem xs