Module type CCMap.S
include Map.S
val empty : 'a tval is_empty : 'a t -> boolval mem : key -> 'a t -> boolval add : key -> 'a -> 'a t -> 'a tval update : key -> ('a option -> 'a option) -> 'a t -> 'a tval singleton : key -> 'a -> 'a tval remove : key -> 'a t -> 'a tval merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c tval union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a tval compare : ('a -> 'a -> int) -> 'a t -> 'a t -> intval equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> boolval iter : (key -> 'a -> unit) -> 'a t -> unitval fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bval for_all : (key -> 'a -> bool) -> 'a t -> boolval exists : (key -> 'a -> bool) -> 'a t -> boolval filter : (key -> 'a -> bool) -> 'a t -> 'a tval partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a tval cardinal : 'a t -> intval bindings : 'a t -> (key * 'a) listval min_binding : 'a t -> key * 'aval min_binding_opt : 'a t -> (key * 'a) optionval max_binding : 'a t -> key * 'aval max_binding_opt : 'a t -> (key * 'a) optionval choose : 'a t -> key * 'aval choose_opt : 'a t -> (key * 'a) optionval split : key -> 'a t -> 'a t * 'a option * 'a tval find : key -> 'a t -> 'aval find_opt : key -> 'a t -> 'a optionval find_first : (key -> bool) -> 'a t -> key * 'aval find_first_opt : (key -> bool) -> 'a t -> (key * 'a) optionval find_last : (key -> bool) -> 'a t -> key * 'aval find_last_opt : (key -> bool) -> 'a t -> (key * 'a) optionval map : ('a -> 'b) -> 'a t -> 'b tval mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val get_or : key -> 'a t -> default:'a -> 'aget_or k m ~defaultreturns the value associated tokif present, and returnsdefaultotherwise (ifkdoesn't belong inm).- since
- 0.16
val update : key -> ('a option -> 'a option) -> 'a t -> 'a tupdate k f mcallsf (Some v)iffind k m = v, otherwise it callsf None. In any case, if the result isNonekis removed fromm, and if the result isSome v'thenadd k v' mis returned.
val min_binding_opt : 'a t -> (key * 'a) optionSafe version of
min_binding.- since
- 1.5
val max_binding_opt : 'a t -> (key * 'a) optionSafe version of
max_binding.- since
- 1.5
val find_first : (key -> bool) -> 'a t -> key * 'aFind smallest binding satisfying the monotonic predicate. See
Map.S.find_first.- since
- 1.5
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) optionSafe version of
find_first.- since
- 1.5
val merge_safe : f:(key -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option) -> 'a t -> 'b t -> 'c tmerge_safe ~f a bmerges the mapsaandbtogether.- since
- 0.17
val union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a tUnion of both maps, using the function to combine bindings that belong to both inputs.
- since
- 1.4