Module type Machine.State

An interface to the state.

An interface gives an access to operations that query and modify machine state.

type 'a m
type 'a t
val get : 'a t -> 'a m

get state extracts the state.

val put : 'a t -> 'a -> unit m

put state x saves a machine state

val update : 'a t -> f:( 'a -> 'a ) -> unit m

update state ~f updates a state using function f.