package containers-data

  1. Overview
  2. Docs
A set of advanced datatypes for containers

Install

Dune Dependency

Authors

Maintainers

Sources

v3.12.tar.gz
md5=d74226924b65697a8558eb34a6074417
sha512=d5094e362f9ad7fe91aa060ef5c9805812cf888b326f0f0070f929205a83169a64c78dfce58a2ec0da77555b21c69a1f287fb38da9867cd6b16507f6c20fa666

doc/containers-data/CCMixmap/module-type-S/index.html

Module type CCMixmap.SSource

Sourcetype key
Sourcetype t

A map containing values of different types, indexed by key.

Sourceval empty : t

Empty map.

Sourceval get : inj:'a injection -> key -> t -> 'a option

Get the value corresponding to this key, if it exists and belongs to the same key.

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

Bind the key to the value, using inj.

Sourceval find : inj:'a injection -> key -> t -> 'a

Find the value for the given key, which must be of the right type.

  • raises Not_found

    if either the key is not found, or if its value doesn't belong to the right type.

Sourceval cardinal : t -> int

Number of bindings.

Sourceval remove : key -> t -> t

Remove the binding for this key.

Sourceval mem : inj:_ injection -> key -> t -> bool

Is the given key in the map, with the right type?

Sourceval iter_keys : f:(key -> unit) -> t -> unit

Iterate on the keys of this map.

Sourceval fold_keys : f:('a -> key -> 'a) -> x:'a -> t -> 'a

Fold over the keys.

Iterators

Sourcetype 'a iter = ('a -> unit) -> unit
Sourceval keys_iter : t -> key iter

All the keys.

Sourceval bindings_of : inj:'a injection -> t -> (key * 'a) iter

All the bindings that come from the corresponding injection.

Sourcetype value =
  1. | Value : ('a injection -> 'a option) -> value
Sourceval bindings : t -> (key * value) iter

Iterate on all bindings.

OCaml

Innovation. Community. Security.

On This Page
  1. Iterators