aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Branch.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-09-19 03:42:12 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-09-19 03:42:12 +0000
commit82f8bf61e1ded0488334ca4a4b859e969cac100f (patch)
treed78ab1930fbc4666fc40fe4f2a4afadba2741f59 /lib/kernel/Branch.ml
parent2e8f23c7802e9afb43a0e9846416f93a63a7e592 (diff)
downloadRNT-82f8bf61e1ded0488334ca4a4b859e969cac100f.tar.gz
RNT-82f8bf61e1ded0488334ca4a4b859e969cac100f.zip
Associative collections on top of prolly trees
Diffstat (limited to '')
-rw-r--r--lib/kernel/Branch.ml13
1 files changed, 9 insertions, 4 deletions
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