package cmarkit

  1. Overview
  2. Docs

Custom context state.

type 'a t

The type for custom state of type 'a.

val make : unit -> 'a t

make () is a new bit of context state.

val find : context -> 'a t -> 'a option

find c state is the state state of context c, if any.

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.

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.