From 327d0d2a47591e02299d4e7360d5b7e03b4962d2 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Sun, 13 Sep 2026 02:31:39 -0300 Subject: delete remaining trash --- lib/kernel/Generator.mli | 4 ---- lib/kernel/Path.ml | 28 ++++++++++++---------------- lib/kernel/Path.mli | 2 +- lib/kernel/Tuple.ml | 4 ++++ 4 files changed, 17 insertions(+), 21 deletions(-) delete mode 100644 lib/kernel/Generator.mli (limited to 'lib/kernel') diff --git a/lib/kernel/Generator.mli b/lib/kernel/Generator.mli deleted file mode 100644 index f30f8ef..0000000 --- a/lib/kernel/Generator.mli +++ /dev/null @@ -1,4 +0,0 @@ -val cursor_of : - ?on_release:(unit -> unit) -> - (yield:(Concepts.Tuple.t -> unit) -> (unit, Concepts.Condition.condition) result) -> - Protocols.Handle.t diff --git a/lib/kernel/Path.ml b/lib/kernel/Path.ml index cd51efb..803d8cf 100644 --- a/lib/kernel/Path.ml +++ b/lib/kernel/Path.ml @@ -1,21 +1,17 @@ -type t = string BatFingerTree.t +type t = string list -let this = BatFingerTree.empty +let this = [] +let (@/) x y = x::y -let of_string s = - String.split_on_char '/' s |> List.filter (fun s -> s <> "") |> BatFingerTree.of_list - -let (@/) segment path = BatFingerTree.cons path segment - -let rec lookup handle path = - let open Utilities.Result in - match BatFingerTree.front path with - | None -> Ok (Some handle) - | Some (rest, segment) -> ( +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* found = Protocols.Directory.find dir segment in - match found with + | Some dir -> + let* elem = Directory.find dir x in + match elem with | None -> Ok None - | Some handle' -> lookup handle' rest)) + | Some elem -> lookup elem xs diff --git a/lib/kernel/Path.mli b/lib/kernel/Path.mli index 9ef4103..85d0ca9 100644 --- a/lib/kernel/Path.mli +++ b/lib/kernel/Path.mli @@ -1,6 +1,6 @@ type t val this : t -val of_string : string -> t val (@/) : string -> t -> t + val lookup : Protocols.Handle.t -> t -> (Protocols.Handle.t option, Concepts.Condition.condition) result diff --git a/lib/kernel/Tuple.ml b/lib/kernel/Tuple.ml index e8f2f7f..50ce5b5 100644 --- a/lib/kernel/Tuple.ml +++ b/lib/kernel/Tuple.ml @@ -42,6 +42,10 @@ module Make (S : Abstract.Storage.STORAGE) = struct module AttributeM = Merkle.Interface (S) (Merkle.StringKey) (Attribute) + (* TODO: ephemeral tuples are served by instantiating this functor + over an in-memory storage. Consider later splitting [t] into + resident (an address) and ephemeral (an in-memory attribute map) + forms instead. *) type t = { type_ : string; attributes : AttributeM.address } module rec Representation : (Concepts.Encoding.Record.S with type t = t) = -- cgit v1.2.3