From 5a6af8a74895b548ed39649aef4a09fb53b4dbbc Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 24 Oct 2026 01:49:53 +0000 Subject: Avoid implementing `Directory` inline? --- lib/kernel/Branch.ml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'lib/kernel/Branch.ml') diff --git a/lib/kernel/Branch.ml b/lib/kernel/Branch.ml index 439339e..89a16ff 100644 --- a/lib/kernel/Branch.ml +++ b/lib/kernel/Branch.ml @@ -143,21 +143,10 @@ module Make (S : Abstract.Storage.STORAGE) = struct update_only (fun node' -> Handle.require Addressable.from node' |> Result.map Addressable.address - |>> (fun addr -> self#deriving {branch with multigroups= addr}) ) ) ] ); - Directory.make - object - method list = - Ok - (BatFingerTree.of_list - ( "multigroup" - :: Option.fold ~none:[] ~some:(fun _ -> ["previous"]) branch.previous ) ) - - method find = - function - | "multigroup" -> Ok (Some multigroups) - | "previous" -> self#previous - | _ -> Ok None - end ] + |>> fun addr -> self#deriving {branch with multigroups= addr} ) ) ] ); + Prototype.Directory.of_properties' + [ ("multigroup", fun () -> Ok (Some multigroups)); + ("previous", fun () -> self#previous) ] ] method hash = Representation.to_blob branch |> Concepts.Hash.hash_of_blob method address = self#hash -- cgit v1.2.3