Writer.Over_monad
module M : Preface_specs.MONAD
module Tape : Preface_specs.MONOID
type tape = Tape.t
The encapsulated tape.
type 'a monad = 'a M.t
The inner monad.
tell
helps to enrich the output. This is done thanks to the semigroup combine operation.
listen
executes the effect and return both the result and the corresponding output within the effect.
Performs the action and adds the result of applying the function to the output to the value of the computation.
pass
executes the effect and apply the function to the corresponding output.
censor
executes the effects, apply the function to the corresponding output and returns an effects with the value unchanged.
module Monad : Preface_specs.Monad.API
include Preface_specs.Indexed_monad.WITH_RETURN
with type ('a, 'index) t := 'a t
include Preface_specs.Indexed_monad.WITH_RETURN
with type ('a, 'index) t := 'a t
include Preface_specs.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 :
Preface_specs.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 :
Preface_specs.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
.