Legend:
Library
Module
Module type
Parameter
Class
Class type
The continuation monad.
The continuation monad reifies computations by making them available as first class values. A continuation encapsulates an evaluation context of a host language (OCaml in our case). The continuation monad behaves like it is a function monad, except that it provides the call/cc operator. The call/cc operator calls a user provided function with a current continuaton. This continuation can be stored in a state (i.e., if the Continuation monad is composed with the State monad) and later resumed. It may also be used to implement various control structures, i.e., exceptions or coroutines.
The same as with the state monad we provide two interfaces, one with the type of final result of the computation is fixed on the module level, and another where it is a type variable.