Context.State
Custom context state.
type 'a t
The type for custom state of type 'a.
'a
val make : unit -> 'a t
make () is a new bit of context state.
make ()
val find : context -> 'a t -> 'a option
find c state is the state state of context c, if any.
find c state
state
c
val get : context -> 'a t -> 'a
get c state is the state state of context c, raises Invalid_argument if there is no state state in c.
get c state
Invalid_argument
val set : context -> 'a t -> 'a option -> unit
set c state s sets the state state of c to s. state is cleared in c if s is None.
set c state s
s
None