From b79224410f469a1cd4ff3be4f8e62d71398109fc Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Fri, 11 Sep 2026 04:06:52 +0000 Subject: Multigroup objects --- lib/kernel/Path.ml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/kernel/Path.ml (limited to 'lib/kernel/Path.ml') 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 -- cgit v1.2.3