Freer_monad.API
The complete interface of a Freer monad
.
The parametric type (which, unlike a Preface_specs.Free_monad
don't need to be a Preface_specs.Functor
).
type ('a, 'b) handle = ('a -> 'b) -> 'a f -> 'b
The handler type. Which is a Natural transformation
from the Freer Monad
to an unwrapped Identity monad
.
A Freer monad
is also an Preface_specs.Functor
.
module Functor : Functor.API with type 'a t = 'a t
A Freer monad
is also an Preface_specs.Applicative
.
module Applicative : Applicative.API with type 'a t = 'a t
A Freer monad
is also an Preface_specs.Selective
.
module Selective : Selective.API with type 'a t = 'a t
A Freer monad
is also (obviously) a Preface_specs.Monad
.
include Indexed_monad.WITH_RETURN with type ('a, 'index) t := 'a t
include Indexed_monad.WITH_RETURN with type ('a, 'index) t := 'a t
include Indexed_monad.WITH_RETURN with type ('a, 'index) t := 'a t
val return : 'a -> 'a t
Lift a value into a t
.
Composing monadic functions using Kleisli Arrow (from right to left).
Lift a binary function that acts on arbitrary values into a function that acts t
values.
Lift a ternary function that acts on arbitrary values into a function that acts t
values.
Create a new t
, replacing all values of the given functor by given a value of 'a
.
module Infix : Indexed_monad.INFIX with type ('a, 'index) t := 'a t
Infix version of OPERATION
.compose_right_to_left.
Sequentially compose two actions, discarding any value produced by the first.
Sequentially compose two actions, discarding any value produced by the second.
Infix version of CORE
.map.
Flipped and infix version of CORE
.map.
Flipped and infix version of OPERATION
.replace.
module Syntax : Indexed_monad.SYNTAX with type ('a, 'index) t := 'a t
Syntactic shortcuts for flipped version of CORE
.bind:
let* x = e in f
is equals to bind (fun x -> f) e
.