Indexed_bind.Via
module Core : Preface_specs.Indexed_bind.CORE
module Operation :
Preface_specs.Indexed_bind.OPERATION
with type ('a, 'index) t = ('a, 'index) Core.t
module Infix :
Preface_specs.Indexed_bind.INFIX
with type ('a, 'index) t = ('a, 'index) Core.t
module Syntax :
Preface_specs.Indexed_bind.SYNTAX
with type ('a, 'index) t = ('a, 'index) Core.t
type ('a, 'index) t = ('a, 'index) Core.t
The type held by the Monad
.
bind f m
passes the result of computation m
to function f
.
join
remove one level of monadic structure, projecting its bound argument into the outer level.
val compose_left_to_right :
('a -> ('b, 'index) t) ->
('b -> ('c, 'index) t) ->
'a ->
('c, 'index) t
Composing monadic functions using Kleisli Arrow (from left to right).
val compose_right_to_left :
('b -> ('c, 'index) t) ->
('a -> ('b, 'index) t) ->
'a ->
('c, 'index) 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.
val lift3 :
('a -> 'b -> 'c -> 'd) ->
('a, 'index) t ->
('b, 'index) t ->
('c, 'index) t ->
('d, 'index) t
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
.
Create a new t
, replacing all values in the given functor by unit
.
module Infix :
Preface_specs.Indexed_bind.INFIX with type ('a, 'index) t := ('a, 'index) t
Infix flipped version of CORE
.bind.
Infix version of CORE
.compose_left_to_right.
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_bind.SYNTAX with type ('a, 'index) t := ('a, 'index) t
Syntactic shortcuts for flipped version of CORE
.bind:
let* x = e in f
is equals to bind (fun x -> f) e
.