Module Relude_ContT.WithMonad
Creates a ContT (continuation) Monad module with the given Monad module.
Parameters
M: BsBastet.Interface.MONAD
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 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 theContT
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 theContT
let pure: r a. 'a => t('r, 'a);
Applicative pure
module WithResult: (R: BsBastet.Interface.TYPE) => { ... };