package seqes
Module Monadic.Make2Source
Parameters
module Mon : sig ... endSignature
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.
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 ... 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).