package seqes
Library
Module
Module type
Parameter
Class
Class type
The module type for the output of the Make2
module (below).
The type of the monad that the specialised Seq variation is built upon. This type is destructively substituted by the application of the functor; it is replaced by the actual monad type passed as parameter.
The Seq-like type: identical to Stdlib.Seq.t
except for mon
.
This include
brings all the functions from the Stdlib.Seq
module but specialised to the specialised Seq variation. E.g., given module SeqMon = Make2(Mon)
then the function SeqMon.map
has type ('a -> 'b) -> ('a, 'e) t -> ('b, 'e) t
and SeqMon.iter
has type ('a -> unit) -> ('a, 'e) t -> (unit, 'e) mon
.
See the documentation of Sigs2
.SEQMON2ALL for more details.
val init : int -> (int -> 'a) -> ('a, 'e) t
val unfold : ('b -> ('a * 'b) option) -> 'b -> ('a, 'e) t
val forever : (unit -> 'a) -> ('a, 'e) t
val iterate : ('a -> 'a) -> 'a -> ('a, 'e) t
val empty : ('a, 'e) t
val return : 'a -> ('a, 'e) t
val repeat : 'a -> ('a, 'e) t
val ints : int -> (int, 'e) t
module M : sig ... end
M
is a module which contains a specialised subset of the functions from the Stdlib.Seq
module. Specifically, it contains those functions which take a function as parameter (e.g., map
but not length
). Moreover, those parameter functions' return type is specialised to be within the mon
monad. E.g., given module SeqMon = Make2(Mon)
then SeqMon.M.map
has type ('a -> ('b, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t
and SeqMon.M.iter
has type ('a -> (unit, 'e) mon) -> ('a, 'e) t -> (unit, 'e) mon
.
Make
is a functor to produce further M
-like modules, but with parameter functions returning into a different monad. E.g., given module SeqMon = Make(Mon)
and module SeqMonMun = SeqMon.Make(Mun)
then SeqMonMun.map
has type ('a -> ('b, 'e) Mun.t) -> ('a, 'e) t -> ('b, 'e) t
.
module MakeTraversors
(Alt : sig ... end)
(Ret : sig ... end)
(GlueAlt : sig ... end)
(GlueMon : sig ... end) :
sig ... end
MakeTraversors
is a functor similar to Make
. It produces only a subset of the functions that Make
does. Specifically, it produces the subset of functions that traverse a sequence (or part thereof) and return a value which is not a sequence (e.g., iter
returning unit
but not map
returning a new sequence).