package stdune

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Stdune.Univ_mapSource

Universal maps

Sourcemodule type S = sig ... end
Sourcemodule Make (Info : sig ... end) () : sig ... end
Sourcemodule Key : sig ... end
include S with module Key := Key
Sourcetype t

A universal map is a map that can store values for arbitrary keys. It is the the key that conveys the type of the data associated to it.

Sourceval empty : t
Sourceval is_empty : t -> bool
Sourceval mem : t -> 'a Key.t -> bool
Sourceval set : t -> 'a Key.t -> 'a -> t
Sourceval add : t -> 'a Key.t -> 'a -> (t, 'a) Result.t
Sourceval update : t -> 'a Key.t -> f:('a option -> 'a option) -> t
Sourceval remove : t -> 'a Key.t -> t
Sourceval find : t -> 'a Key.t -> 'a option
Sourceval find_exn : t -> 'a Key.t -> 'a
Sourceval singleton : 'a Key.t -> 'a -> t
Sourceval superpose : t -> t -> t

superpose a b is a augmented with bindings of b that are not in a.

Sourcetype 'acc fold = {
  1. fold : 'a. 'a Key.info -> 'a -> 'acc -> 'acc;
}
Sourceval fold : t -> init:'acc -> f:'acc fold -> 'acc
Sourceval to_dyn : t -> Dyn.t
OCaml

Innovation. Community. Security.