Module Hmap
Heterogeneous value maps.
v0.8.1 - homepage
Keys
module Key : sig ... endKeys.
Maps
val empty : Hmap.tempty is the empty map.
val is_empty : Hmap.t -> boolis_empty m is true iff m is empty.
The type for bindings.
val iter : (Hmap.binding -> unit) -> Hmap.t -> unititer f m applies f to all bindings of m.
val fold : (Hmap.binding -> 'a -> 'a) -> Hmap.t -> 'a -> 'afold f m acc folds over the bindings of m with f, starting with acc
val for_all : (Hmap.binding -> bool) -> Hmap.t -> boolfor_all p m is true iff all bindings of m satisfy p.
val exists : (Hmap.binding -> bool) -> Hmap.t -> boolexists p m is true iff there exists a bindings of m that satisfies p.
val filter : (Hmap.binding -> bool) -> Hmap.t -> Hmap.tfilter p m are the bindings of m that satisfy p.
val cardinal : Hmap.t -> intcardinal m is the number of bindings in m.
val any_binding : Hmap.t -> Hmap.binding optionany_binding m is a binding of m (if not empty).
val get_any_binding : Hmap.t -> Hmap.bindingget_any_binding m is a binding of m.
Functorial interface
The functorial interface allows to associate more information to the keys. For example a key name or a key value pretty-printer.
module type KEY_INFO = sig ... endThe type for key information.
module Make
(Key_info : Hmap.KEY_INFO) :
Hmap.S with type 'a Key.info = 'a Key_info.tFunctor for heterogeneous maps whose keys hold information of type Key_info.t