String.MapString maps.
include Stdlib.Map.S
with type key := string
with type 'a t = 'a Stdlib.Map.Make(Stdlib.String).tval empty : 'a tval singleton : string -> 'a -> 'a tval cardinal : 'a t -> intval bindings : 'a t -> (string * 'a) listval min_binding : 'a t -> string * 'aval min_binding_opt : 'a t -> (string * 'a) optionval max_binding : 'a t -> string * 'aval max_binding_opt : 'a t -> (string * 'a) optionval choose : 'a t -> string * 'aval choose_opt : 'a t -> (string * 'a) optionval find : string -> 'a t -> 'aval find_opt : string -> 'a t -> 'a optionval find_first : (string -> bool) -> 'a t -> string * 'aval find_first_opt : (string -> bool) -> 'a t -> (string * 'a) optionval find_last : (string -> bool) -> 'a t -> string * 'aval find_last_opt : (string -> bool) -> 'a t -> (string * 'a) optionval iter : (string -> 'a -> unit) -> 'a t -> unitval fold : (string -> 'a -> 'acc -> 'acc) -> 'a t -> 'acc -> 'accval is_empty : 'a t -> boolval mem : string -> 'a t -> boolval for_all : (string -> 'a -> bool) -> 'a t -> boolval exists : (string -> 'a -> bool) -> 'a t -> boolval to_list : 'a t -> (string * 'a) listval to_seq : 'a t -> (string * 'a) Stdlib.Seq.tval to_rev_seq : 'a t -> (string * 'a) Stdlib.Seq.tval to_seq_from : string -> 'a t -> (string * 'a) Stdlib.Seq.tval of_seq : (string * 'a) Stdlib.Seq.t -> 'a tval of_list : (string * 'a) list -> 'a tof_list bs is List.fold_left (fun m (k, v) -> add k v m) empty bs.
Available in 5.1
add k v m is m with k mapping to l such that l is v :: find k m if k was bound in m and [v] otherwise.
Available in 5.1.
val add_to_set :
(module Stdlib.Set.S with type elt = 'a and type t = 'set) ->
string ->
'a ->
'set t ->
'set tadd (module S) k v m is m with k mapping to s such that s is S.add v (find k m) if k was bound in m and S.singleton [v] otherwise.
val get_or_suggest : string -> 'a t -> ('a, string list) Stdlib.resultget_or_suggest k m is Ok v if k is bound to v in m and otherwise a (possibly empty) list of suggested keys whose name could match name.
val get_or_hint :
?pp_key:string Fmt.t ->
kind:string ->
string ->
'a t ->
('a, string) Stdlib.resultget_or_hint is like get_or_suggest but it formats an error message that indicate that the kind of key k could not be found and suggests alternative names (if any). pp_key is used to format the keys, it default to Fmt.code'.
pp ~sep pp_binding ppf m formats the bindings of m on ppf. Each binding is formatted with pp_binding and bindings are separated by sep (defaults to Format.pp_print_cut). If the map is empty leaves ppf untouched.
pp_dump pp_v ppf m formats a map for inspection using pp_v to format codomain elements.