package seqes
Module type Monadic.S1Source
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.
val init : int -> (int -> 'a) -> 'a tval unfold : ('b -> ('a * 'b) option) -> 'b -> 'a tval forever : (unit -> 'a) -> 'a tval iterate : ('a -> 'a) -> 'a -> 'a tval empty : 'a tval return : 'a -> 'a tval repeat : 'a -> 'a tval ints : int -> int tmodule M : sig ... endM 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 ... endMakeTraversors 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).
module MakeTraversors2
(Alt : sig ... end)
(Ret : sig ... end)
(GlueAlt : sig ... end)
(GlueMon : sig ... end) :
sig ... endMakeTraversors2 is a functor similar to MakeTraversors but for a two-parameter monad.