Commits

Dmitry Grebeniuk  committed 8d6602d

+ Cadastr.Sfun.trie_merge_monoid

  • Participants
  • Parent commits 45c9417

Comments (0)

Files changed (1)

File src/cadastr.ml

     ;
 
 
+    value trie_merge_monoid
+     : trie 'k 'v -> Monoid.t 'v -> Monoid.t (trie 'k 'v)
+     = fun trie node_monoid ->
+         let merge_node _path xs ys =
+           [ Cd_List.List.reduce node_monoid (xs @ ys) ] in
+         new Monoid.t
+           trie
+           (fun a b -> a#merge_trie merge_node b)
+    ;
+
+
   end  (* module Sfun *)
 ;