package hmap

  1. Overview
  2. Docs

Module type Hmap.SSource

Output signature of the functor Make

Keys

Sourcetype 'a key

The type for keys whose lookup value is of type 'a.

Sourcemodule Key : sig ... end

Keys.

Maps

Sourcetype t

The type for heterogeneous value maps.

Sourceval empty : t

empty is the empty map.

Sourceval is_empty : t -> bool

is_empty m is true iff m is empty.

Sourceval mem : 'a key -> t -> bool

mem k m is true iff k is bound in m.

Sourceval add : 'a key -> 'a -> t -> t

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

Sourceval singleton : 'a key -> 'a -> t

singleton k v is add k v empty.

Sourceval rem : 'a key -> t -> t

rem k m is m with k unbound.

Sourceval find : 'a key -> t -> 'a option

find k m is the value of k's binding in m, if any.

Sourceval get : 'a key -> t -> 'a

get k m is the value of k's binding in m.

Sourcetype binding =
  1. | B : 'a key * 'a -> binding

The type for bindings.

Sourceval iter : (binding -> unit) -> t -> unit

iter f m applies f to all bindings of m.

Sourceval fold : (binding -> 'a -> 'a) -> t -> 'a -> 'a

fold f m acc folds over the bindings of m with f, starting with acc

Sourceval for_all : (binding -> bool) -> t -> bool

for_all p m is true iff all bindings of m satisfy p.

Sourceval exists : (binding -> bool) -> t -> bool

exists p m is true iff there exists a bindings of m that satisfies p.

Sourceval filter : (binding -> bool) -> t -> t

filter p m are the bindings of m that satisfy p.

Sourceval cardinal : t -> int

cardinal m is the number of bindings in m.

Sourceval any_binding : t -> binding option

any_binding m is a binding of m (if not empty).

Sourceval get_any_binding : t -> binding

get_any_binding m is a binding of m.