module State: sig
.. end
Definition of checks states.
type
id
The type of state identifiers.
type 'a
getter = id -> 'a
The type of function used for retrieving a state from an identifier.
type 'a
setter = id -> 'a -> unit
The type of function used for setting a state from an identifier.
val next_id : unit -> id
Returns a new state identifier.
val init : (unit -> 'a) -> 'a getter * 'a setter
init f
Initializes a (collection of) state(s) by returning a pair that
consist of a getter and setter. The function f
will be used to create
an initial value for the state; it will be called upon the first try to
retrieve an element, if it has not been set before.