package mnd
Library
Module
Module type
Parameter
Class
Class type
The monad interface with let*
-syntax, common operators and functions. These are the elements you get when instantiating a monad with Make
.
This is just syntactic sugar for map
: let+ x = m in f x
is the same as map f m
.
This is just syntactic sugar for bind
: let* x = m in f x
is the same as bind m f
.
Operator version of bind
, i.e. m1 >>= m2
is the same as bind m1 m2
Like (>>=)
but ignores the result of the first monad, i.e. m1 >> m2
is the same as m1 >>= fun _ -> m2
This is the operator version of map
, i.e. m |>> f
is the same as map f m
Monadic version of List.fold_left
: the folding function computes the new accumulator value inside the monad.
Same as foldM
but the first element of the list is taken as the initial accumulator value. Throws an Invalid_argument
exception on the empty list.
Monadic version of List.map
: the new elements are computed inside the monad.