Module Const.Map
type key = tmodule Set = Setval empty : 'a tval is_empty : 'a t -> boolWhen the function always returns Some _, union_total has better performance.
union_sharing f m1 m2 is a version of union f m1 m2 that maximizes sharing of the result with m1.
union_shared f m1 m2 is a version of union_sharing f m1 m2 that also exploits sharing of m1 and m2 to avoid calling f when possible, assuming that f x x = Some x for all xs.
union_total f m1 m2 is the same as union (fun k x y -> Some (f k x y)) m1 m2
union_total_shared f m1 m2 is a version of union_total f m1 m2 that also exploits sharing of m1 and m2 to avoid calling f when possible, assuming that f k x x = x for all keys k and values x. It also maximises sharing with m1.
union_left_biased m1 m2 is the same as union_total_shared (fun _ l _ -> l) m1 m2
union_right_biased m1 m2 is the same as union_total_shared (fun _ _ r -> r) m1 m2
val cardinal : 'a t -> intval print_debug :
(Format.formatter -> 'a -> unit) ->
Format.formatter ->
'a t ->
unitval disjoint_union :
?eq:('a -> 'a -> bool) ->
?print:(Format.formatter -> 'a -> unit) ->
'a t ->
'a t ->
'a tval data : 'a t -> 'a listval print :
(Format.formatter -> 'a -> unit) ->
Format.formatter ->
'a t ->
unitdiff f m1 m2 computes a map whose keys are a subset of the keys of m1. When a binding is defined in both m1 and m2, the function f is used to combine them. Bindings that are only present in m1 are preserved. This is a special case of merge: diff f m1 m2 is equivalent to merge f' m1 m2, where
f' _key None _ = Nonef' _key (Some v) None = Some vf' key (Some v1) (Some v2) = f key v1 v2
diff_sharing f m1 m2 is a version of diff f m1 m2 that maximizes sharing of the result with m1.
diff_shared f m1 m2 is a version of diff_sharing f m1 m2 that further exploits sharing of m1 and m2 to avoid calling f when possible, assuming that f x x always returns None.