package prom
Library
Module
Module type
Parameter
Class
Class type
include Stdlib.Map.S with type key := string
val empty : 'a t
val is_empty : 'a t -> bool
val mem : string -> 'a t -> bool
val singleton : string -> 'a -> 'a t
val iter : (string -> 'a -> unit) -> 'a t -> unit
val fold : (string -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val for_all : (string -> 'a -> bool) -> 'a t -> bool
val exists : (string -> 'a -> bool) -> 'a t -> bool
val cardinal : 'a t -> int
val bindings : 'a t -> (string * 'a) list
val min_binding : 'a t -> string * 'a
val max_binding : 'a t -> string * 'a
val choose : 'a t -> string * 'a
val find : string -> 'a t -> 'a
val find_last : (string -> bool) -> 'a t -> string * 'a
val find_last_opt : (string -> bool) -> 'a t -> (string * 'a) option
val to_rev_seq : 'a t -> (string * 'a) Stdlib.Seq.t
val to_seq_from : string -> 'a t -> (string * 'a) Stdlib.Seq.t
val get_or : string -> 'a t -> default:'a -> 'a
get_or k m ~default
returns the value associated to k
if present, and returns default
otherwise (if k
doesn't belong in m
).
update k f m
calls f (Some v)
if find k m = v
, otherwise it calls f None
. In any case, if the result is None
k
is removed from m
, and if the result is Some v'
then add k v' m
is returned.
val min_binding_opt : 'a t -> (string * 'a) option
Safe version of min_binding
.
val max_binding_opt : 'a t -> (string * 'a) option
Safe version of max_binding
.
val find_first : (string -> bool) -> 'a t -> string * 'a
Find smallest binding satisfying the monotonic predicate. See Map.S.find_first
.
val find_first_opt : (string -> bool) -> 'a t -> (string * 'a) option
Safe version of find_first
.
val merge_safe :
f:(string -> [ `Left of 'a | `Right of 'b | `Both of 'a * 'b ] -> 'c option) ->
'a t ->
'b t ->
'c t
merge_safe ~f a b
merges the maps a
and b
together.
Union of both maps, using the function to combine bindings that belong to both inputs.
val add_iter : 'a t -> (string * 'a) CCMap.iter -> 'a t
Like add_list
.
val of_iter : (string * 'a) CCMap.iter -> 'a t
Like of_list
.
val to_iter : 'a t -> (string * 'a) CCMap.iter
Like to_list
.
val of_seq : (string * 'a) CCMap.sequence -> 'a t
val add_seq : 'a t -> (string * 'a) CCMap.sequence -> 'a t
val to_seq : 'a t -> (string * 'a) CCMap.sequence
val of_list : (string * 'a) list -> 'a t
Build a map from the given list of bindings k_i -> v_i
, added in order using add
. If a key occurs several times, only its last binding will be present in the result.
val keys : _ t -> string CCMap.iter
Iterate on keys only.
val values : 'a t -> 'a CCMap.iter
Iterate on values only.
val to_list : 'a t -> (string * 'a) list
val pp :
?start:string ->
?stop:string ->
?arrow:string ->
?sep:string ->
string CCMap.printer ->
'a CCMap.printer ->
'a t CCMap.printer