package seqes

  1. Overview
  2. Docs

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).

In this subset it is possible to mix the monad in more complex ways. And thus the monad-combining machinery provided as functor parameter is more complex.

See examples/ for use.

See the documentation of Sigs2.SEQMON2TRAVERSORS for more details.

Parameters

module Alt : sig ... end
module Ret : sig ... end
module GlueAlt : sig ... end
module GlueMon : sig ... end

Signature

val iter : ('a -> (unit, 'e) Alt.t) -> ('a, 'e) t -> (unit, 'e) Ret.t
val fold_left : ('a -> 'b -> ('a, 'e) Alt.t) -> 'a -> ('b, 'e) t -> ('a, 'e) Ret.t
val iteri : (int -> 'a -> (unit, 'e) Alt.t) -> ('a, 'e) t -> (unit, 'e) Ret.t
val fold_lefti : ('b -> int -> 'a -> ('b, 'e) Alt.t) -> 'b -> ('a, 'e) t -> ('b, 'e) Ret.t
val for_all : ('a -> (bool, 'e) Alt.t) -> ('a, 'e) t -> (bool, 'e) Ret.t
val exists : ('a -> (bool, 'e) Alt.t) -> ('a, 'e) t -> (bool, 'e) Ret.t
val find : ('a -> (bool, 'e) Alt.t) -> ('a, 'e) t -> ('a option, 'e) Ret.t
val find_map : ('a -> ('b option, 'e) Alt.t) -> ('a, 'e) t -> ('b option, 'e) Ret.t
val iter2 : ('a -> 'b -> (unit, 'e) Alt.t) -> ('a, 'e) t -> ('b, 'e) t -> (unit, 'e) Ret.t
val fold_left2 : ('a -> 'b -> 'c -> ('a, 'e) Alt.t) -> 'a -> ('b, 'e) t -> ('c, 'e) t -> ('a, 'e) Ret.t
val for_all2 : ('a -> 'b -> (bool, 'e) Alt.t) -> ('a, 'e) t -> ('b, 'e) t -> (bool, 'e) Ret.t
val exists2 : ('a -> 'b -> (bool, 'e) Alt.t) -> ('a, 'e) t -> ('b, 'e) t -> (bool, 'e) Ret.t
OCaml

Innovation. Community. Security.