package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=151ca6df499bd3de7aa89a4e1627411fbee24c4dea6e0e71ce21f06f181ee654
md5=00393728b481c2bf15919a8202732335
doc/orsetto.cf/Cf_seqmonad/index.html
Module Cf_seqmonad
Monad functions for functional progressive sequences.
Overview
This module augments the core monad interfaces with functions that facilitate monad functions that operate on sequences of monad values. It also provides a distinguished monad that encapsulates a sequence.
module Functor : sig ... end
Sequence Monad
Module inclusions
module Basis : Cf_monad_core.Binary.Basis with type ('m, 'r) t := ('m, 'r) t
include Cf_monad_core.Binary.Profile with type ('m, 'r) t := ('m, 'r) t
val return : 'r -> ('m, 'r) t
Use return a
to apply the binding to a
.
Use bind m f
to bind f
to the value returned by m
.
Use map m f
to return the result of applying f
to the value returned by m
.
module Infix : Cf_monad_core.Binary.Infix with type ('m, 'r) t := ('m, 'r) t
Open Infix
to include the infix monad operators.
include Functor.Binary with type ('m, 'r) t := ('m, 'r) t
Use collect s
to bind in sequence every monad value in the finite sequence s
and collect all the returned values. Returns (n, s)
where n
is the number of values collected and s
is the list of values in reverse order, i.e. from last collected to first collected. Never returns and exhausts all memory if s
never terminates.
val one : 'm -> ('m, unit) t
Use one v
to produce the value v
in the encapsulated sequence.
Use all s
to produce each value consumed from s
in the encapsulated sequence.