Module Relude_ContT.WithMonad

Creates a ContT (continuation) Monad module with the given Monad module.

Parameters

Signature

type t('r, 'a) =
| ContT(('a => M.t('r)) => M.t('r))
;

The type of a continuation. 'a is the intermediate result type, and 'r is the final result type.

let make: (('a => M.t('r)) => M.t('r)) => t('r'a);

Constructs a ContT

let runContT: a r. ('a => M.t('r)) => t('r'a) => M.t('r);

Runs the computation by providing a final continuation callback

let mapContT: a r. (M.t('r) => M.t('r)) => t('r'a) => t('r'a);

Modify the underlying action in a ContT monad

let withContT: r a b. (('b => M.t('r)) => 'a => M.t('r)) => t('r'a) => t('r'b);

Modify the continuation in a ContT monad

let map: r a b. ('a => 'b) => t('r'a) => t('r'b);

Maps a pure function over the intermediate type 'a of the ContT

let apply: r a b. t('r'a => 'b) => t('r'a) => t('r'b);

Applies a wrapped function over the intermediate type 'a of the ContT

let pure: r a. 'a => t('r'a);

Applicative pure

let bind: r a b. t('r'a) => ('a => t('r'b)) => t('r'b);

Monad bind

module WithResult: (R: BsBastet.Interface.TYPE) => { ... };