package preface
Module Indexed_monad_plus.Via
Parameters
module Operation :
Preface_specs.Indexed_monad_plus.OPERATION
with type ('a, 'index) t = ('a, 'index) Core.tmodule Infix :
Preface_specs.Indexed_monad_plus.INFIX
with type ('a, 'index) t = ('a, 'index) Core.tmodule Syntax :
Preface_specs.Indexed_monad_plus.SYNTAX
with type ('a, 'index) t = ('a, 'index) Core.tSignature
Type
type ('a, 'index) t = ('a, 'index) Core.tThe type held by the Indexed Monad Plus.
Functions
include Preface_specs.Indexed_monad.WITH_RETURN
with type ('a, 'index) t := ('a, 'index) t
include Preface_specs.Indexed_monad.WITH_RETURN
with type ('a, 'index) t := ('a, 'index) t
include Preface_specs.Indexed_bind.WITH_MAP_AND_JOIN
with type ('a, 'index) t := ('a, 'index) t
include Preface_specs.Indexed_monad.WITH_RETURN
with type ('a, 'index) t := ('a, 'index) t
val return : 'a -> ('a, 'index) tLift a value into a t.
val neutral : ('a, 'index) tThe neutral element of the t.
val compose_right_to_left :
('b -> ('c, 'index) t) ->
('a -> ('b, 'index) t) ->
'a ->
('c, 'index) tComposing 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) tLift a ternary function that acts on arbitrary values into a function that acts t values.
times_nel n x apply combine on x n times. If n is lower than 1 the function will returns None.
val reduce_nel : ('a, 'index) t Preface_core.Nonempty_list.t -> ('a, 'index) tReduce a Nonempty_list.t using combine.
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.
times n x apply combine on x n times. If n is lower than 1 the function will returns neutral.
Infix operators
module Infix :
Preface_specs.Indexed_monad_plus.INFIX
with type ('a, 'index) t := ('a, 'index) tInfix 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.
Syntax
module Syntax :
Preface_specs.Indexed_monad_plus.SYNTAX
with type ('a, 'index) t := ('a, 'index) tSyntactic shortcuts for flipped version of CORE.bind:
let* x = e in f is equals to bind (fun x -> f) e.