From 82f8bf61e1ded0488334ca4a4b859e969cac100f Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Sat, 19 Sep 2026 03:42:12 +0000 Subject: Associative collections on top of prolly trees --- lib/kernel/Branch.ml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'lib/kernel/Branch.ml') diff --git a/lib/kernel/Branch.ml b/lib/kernel/Branch.ml index 3832a07..54d5aaf 100644 --- a/lib/kernel/Branch.ml +++ b/lib/kernel/Branch.ml @@ -11,6 +11,7 @@ module Make (S : Abstract.Storage.STORAGE) = struct module M = Multigroup.Make (S) module MultigroupM = Merkle.Interface (S) (Merkle.StringKey) (M) module MMDirectory = Prototype.Directory.OfTree (S) (Merkle.StringKey) (M) + module MMAssociative = Prototype.Associative.OfTree (S) (Merkle.StringKey) module Error = struct open Concepts.Condition @@ -69,10 +70,14 @@ module Make (S : Abstract.Storage.STORAGE) = struct method protocols : Protocols.Handle.protocol list = Protocols.[ Addressable.make self; Prototype.Directory.of_properties - [ "multigroup", Prototype.mixture - [ MMDirectory.make - ~storage ~node - ~constructor:(M.wrap storage) ] ] ] + [ "multigroup", Prototype.mixture_of node + (fun make node -> + [ MMDirectory.make + ~storage ~node + ~constructor:(M.wrap storage); + MMAssociative.make + ~storage ~node:(MultigroupM.into node) + ~constructor:(fun node' -> MultigroupM.from node' |> make |> Result.ok) ]) ] ] method hash = Representation.to_blob branch -- cgit v1.2.3