Module C2.Map
include Flambda2_algorithms.Container_types_intf.Map
with type key = C2.t
with module Set = C2.Set
type key = C2.tmodule Set = C2.Setval empty : 'a C2.Map.tval is_empty : 'a C2.Map.t -> boolval mem : C2.Map.key -> 'a C2.Map.t -> boolval add : C2.Map.key -> 'a -> 'a C2.Map.t -> 'a C2.Map.tval update :
C2.Map.key ->
('a option -> 'a option) ->
'a C2.Map.t ->
'a C2.Map.tval singleton : C2.Map.key -> 'a -> 'a C2.Map.tval remove : C2.Map.key -> 'a C2.Map.t -> 'a C2.Map.tval merge :
(C2.Map.key -> 'a option -> 'b option -> 'c option) ->
'a C2.Map.t ->
'b C2.Map.t ->
'c C2.Map.tval union :
(C2.Map.key -> 'a -> 'a -> 'a option) ->
'a C2.Map.t ->
'a C2.Map.t ->
'a C2.Map.tval union_sharing :
(C2.Map.key -> 'a -> 'a -> 'a option) ->
'a C2.Map.t ->
'a C2.Map.t ->
'a C2.Map.tunion_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.
val update_many :
(C2.Map.key -> 'a option -> 'b -> 'a option) ->
'a C2.Map.t ->
'b C2.Map.t ->
'a C2.Map.tval iter : (C2.Map.key -> 'a -> unit) -> 'a C2.Map.t -> unitval fold : (C2.Map.key -> 'a -> 'b -> 'b) -> 'a C2.Map.t -> 'b -> 'bval for_all : (C2.Map.key -> 'a -> bool) -> 'a C2.Map.t -> boolval exists : (C2.Map.key -> 'a -> bool) -> 'a C2.Map.t -> boolval filter : (C2.Map.key -> 'a -> bool) -> 'a C2.Map.t -> 'a C2.Map.tval filter_map : (C2.Map.key -> 'a -> 'b option) -> 'a C2.Map.t -> 'b C2.Map.tval filter_map_sharing :
(C2.Map.key -> 'a -> 'a option) ->
'a C2.Map.t ->
'a C2.Map.tval partition :
(C2.Map.key -> 'a -> bool) ->
'a C2.Map.t ->
'a C2.Map.t * 'a C2.Map.tval cardinal : 'a C2.Map.t -> intval bindings : 'a C2.Map.t -> (C2.Map.key * 'a) listval min_binding : 'a C2.Map.t -> C2.Map.key * 'aval min_binding_opt : 'a C2.Map.t -> (C2.Map.key * 'a) optionval max_binding : 'a C2.Map.t -> C2.Map.key * 'aval max_binding_opt : 'a C2.Map.t -> (C2.Map.key * 'a) optionval choose : 'a C2.Map.t -> C2.Map.key * 'aval choose_opt : 'a C2.Map.t -> (C2.Map.key * 'a) optionval split : C2.Map.key -> 'a C2.Map.t -> 'a C2.Map.t * 'a option * 'a C2.Map.tval find : C2.Map.key -> 'a C2.Map.t -> 'aval find_opt : C2.Map.key -> 'a C2.Map.t -> 'a optionval mapi : (C2.Map.key -> 'a -> 'b) -> 'a C2.Map.t -> 'b C2.Map.tval to_seq : 'a C2.Map.t -> (C2.Map.key * 'a) Stdlib.Seq.tval print_debug :
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a C2.Map.t ->
unitval of_list : (C2.Map.key * 'a) list -> 'a C2.Map.tval disjoint_union :
?eq:('a -> 'a -> bool) ->
?print:(Stdlib.Format.formatter -> 'a -> unit) ->
'a C2.Map.t ->
'a C2.Map.t ->
'a C2.Map.tval map_keys : (C2.Map.key -> C2.Map.key) -> 'a C2.Map.t -> 'a C2.Map.tval data : 'a C2.Map.t -> 'a listval of_set : (C2.Map.key -> 'a) -> Set.t -> 'a C2.Map.tval print :
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a C2.Map.t ->
unitval inter :
(C2.Map.key -> 'a -> 'b -> 'c) ->
'a C2.Map.t ->
'b C2.Map.t ->
'c C2.Map.tval diff :
(C2.Map.key -> 'a -> 'b -> 'a option) ->
'a C2.Map.t ->
'b C2.Map.t ->
'a C2.Map.tdiff 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
val diff_sharing :
(C2.Map.key -> 'a -> 'b -> 'a option) ->
'a C2.Map.t ->
'b C2.Map.t ->
'a C2.Map.tdiff_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.
val get_singleton : 'a C2.Map.t -> (C2.Map.key * 'a) optionval replace : C2.Map.key -> ('a -> 'a) -> 'a C2.Map.t -> 'a C2.Map.tval iterator : 'a C2.Map.t -> 'a C2.Map.iteratoriterator t returns an iterator for all the bindings in t, initially positioned on min_binding t.
val current : 'a C2.Map.iterator -> (C2.Map.key * 'a) optioncurrent iterator returns the key-value pair at the current position, or None if the iterator is exhausted.
val advance : 'a C2.Map.iterator -> 'a C2.Map.iteratoradvance iterator position the iterator on the next key.
val seek : 'a C2.Map.iterator -> C2.Map.key -> 'a C2.Map.iteratorseek iterator key positions the iterator on the next key higher or equal to the provided key.
Note: does nothing if key is less than or equal to the current key.