(** A monad that returns [unit] and performs no operation. *)

val nil: ('s, 'x, unit) t

-(** Use [return a] to produce a monad that returns [a] as an intermediate

- result from the current continuation.

+(** Use [return a] to produce a monad that returns [a]. *)

val return: 'a -> ('s, 'x, 'a) t

(** Use [init x] to produce a monad that discards the current intermediate

- ~~result and return~~s [x] ~~as~~ the continuation~~ context~~.

+ context and passes [x] into the continuation.

val init: 'x -> ('s, 'x, 'a) t

-(** Use [cont f] to produce a monad that passes the calling continuation to

- the function [f] and returns the unit value as an intermediate result.

+(** Use [cont f] to produce a monad that applies [f] to the current

+ intermediate context and passes the result into the continuation.

val cont: ('x -> 'x) -> ('s, 'x, unit) t

-(** A monad that returns the encapsulate state~~ as an intermediate result~~. *)

+(** A monad that returns the encapsulate state. *)

-(** Use [store s] to produce a monad with [s] as the value of its encapsulated

+(** Use [store s] to produce a monad with [s] as the encapsulated state. *)

val store: 's -> ('s, 'x, unit) t

(** Use [modify f] to produce a monad that applies [f] to the encapsulated

- state to obtain a new state value, and which returns the unit value as its

+ state to obtain a new state value.

val modify: ('s -> 's) -> ('s, 'x, unit) t

-(** Use [field f] to produce a monad that returns the result of applying [f] to

- the value of the encapsulated state.

+(** Use [field f] to produce a monad that applies [f] to the encapsulated state

+ and returns the result.

val field: ('s -> 'a) -> ('s, 'x, 'a) t

(** Use [down m s] to produce a stateless continuation monad from a

- state-continuation monad and an initial state.

+ state-continuation monad [m] and an initial state [s].

val down: ('s, 'x, unit) t -> 's -> ('x, 's) Cf_cmonad.t

-(** Use [lift m] to lift a stateless continuation monad into a

+(** Use [lift m] to lift a stateless continuation monad [m] into a

state-continuation monad.

val lift: ('x, 'a) Cf_cmonad.t -> ('s, 'x, 'a) t

(** Use [eval m s] to evaluate the state-continuation monad [m] with initial

- state [s] to produce a function from initial continuation context to final

+ state [s] to produce a function from an initial context to a final context.

val eval: ('s, 'x, unit) t -> 's -> 'x -> 'x