Module type Map_like.MAP

Generic map interface.

type t

The type for maps.

type key

The type for map keys.

type value

The type for map values.

val empty : t

empty is an empty map.

val mem : key -> t -> bool

mem k m is true iff m has a binding for k.

val add : key -> value -> t -> t

add k v m is m with k binding to v.

val remove : key -> t -> t

remove k m is m without a binding for k.

val find_opt : key -> t -> value option

find_opt k m is the binding for key k in m (if any).

val fold : (key -> value -> 'acc -> 'acc) -> t -> 'acc -> 'acc

fold f m init folds over the bindings of m with f starting with init.

val equal : (value -> value -> bool) -> t -> t -> bool

equal eq m0 m1 tests whether m0 and m1 contain equal keys and associate them with equal values according to eq

val compare : (value -> value -> int) -> t -> t -> int

compare cmp m0 m1 totally order m0 and m1 with cmp used to compare the values of equal keys.

val pp_applied_name : Stdlib.Format.formatter -> unit -> unit

pp_applied_name ppf () formats an applied name for the map type.