Module Monads.Std.Monad.State.Multi

module Multi: sig .. end
The Multi State monad.

The multi state monad is a generalization of a state monad where a computation can have simultaneously more than one state. It can be used to denote non-deterministic effects and concurrent computations.

The multi state monad introduces two new operators: fork and switch. The fork operator clones (replicates) current state of computation (environment), the switch operator chooses between different available states.

States form a hierarchy, with a state in which fork is called being a parent of a newly forked state. The initial state, called the global state is an ancestor of all states.


type status = [ `Current | `Dead | `Live ] 
type 'a contexts 
type id 
module Id: sig .. end
module type S = sig .. end
module type S2 = sig .. end
module T1 (T : Std.T)  (M : Std.Monad.Monad) : sig .. end
module T2 (M : Std.Monad.Monad) : sig .. end
module Make (T : Std.T)  (M : Std.Monad.Monad) : S 
          with type 'a t := 'a T1(T)(M).t
           and type 'a m := 'a T1(T)(M).m
           and type 'a e := 'a T1(T)(M).e
           and type env := T.t
           and type id := id
           and module Id := Id
module Make2 (M : Std.Monad.Monad) : S2 
          with type ('a,'e) t := ('a,'e) T2(M).t
           and type 'a m     := 'a     T2(M).m
           and type ('a,'e) e := ('a,'e) T2(M).e
           and type id := id
           and module Id := Id