package seqes
Library
Module
Module type
Parameter
Class
Class type
The module type for the output of the Make
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.
This include
brings all the functions from the Stdlib.Seq
module but specialised to the specialised Seq variation. E.g., given module SeqMon = Make(Mon)
then the function SeqMon.map
has type ('a -> 'b) -> 'a t -> 'b t
and SeqMon.iter
has type ('a -> unit) -> 'a t -> unit mon
.
See the documentation of Sigs1
.SEQMON1ALL for more details.
Any monad that we can use to produce transformers, we can also use to produce traversors. Thus, SEQMON1TRANSFORMERS
includes SEQMON1TRAVERSORS
and all the functors producing transformer also produce traversors.
See Stdlib.Seq.iter
See Stdlib.Seq.iteri
See Stdlib.Seq.find
See Stdlib.Seq.iter2
val init : int -> (int -> 'a) -> 'a t
See Stdlib.Seq.init
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t
val forever : (unit -> 'a) -> 'a t
val iterate : ('a -> 'a) -> 'a -> 'a t
See Stdlib.Seq.map
See Stdlib.Seq.mapi
See Stdlib.Seq.scan
See Stdlib.Seq.group
See Stdlib.Seq.map2
See Stdlib.Seq.equal
val empty : 'a t
See Stdlib.Seq.empty
val return : 'a -> 'a t
See Stdlib.Seq.cons
val repeat : 'a -> 'a t
See Stdlib.Seq.cycle
See Stdlib.Seq.take
See Stdlib.Seq.drop
See Stdlib.Seq.once
See Stdlib.Seq.zip
See Stdlib.Seq.unzip
See Stdlib.Seq.split
val ints : int -> int t
See Stdlib.Seq.ints
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 = Make(Mon)
then SeqMon.M.map
has type ('a -> 'b Mon.t) -> 'a t -> 'b t
and SeqMon.M.iter
has type ('a -> unit mon) -> 'a t -> unit 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 Mun.t) -> 'a t -> 'b 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).