package seqes

  1. Overview
  2. Docs

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.

See the documentation of Sigs2.SEQMON2TRANSFORMERS for more details.

val iter : ('a -> (unit, 'e) Mon.t) -> ('a, 'e) t -> (unit, 'e) Mon.t
val fold_left : ('a -> 'b -> ('a, 'e) Mon.t) -> 'a -> ('b, 'e) t -> ('a, 'e) Mon.t
val iteri : (int -> 'a -> (unit, 'e) Mon.t) -> ('a, 'e) t -> (unit, 'e) Mon.t
val fold_lefti : ('b -> int -> 'a -> ('b, 'e) Mon.t) -> 'b -> ('a, 'e) t -> ('b, 'e) Mon.t
val for_all : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> (bool, 'e) Mon.t
val exists : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> (bool, 'e) Mon.t
val find : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('a option, 'e) Mon.t
val find_map : ('a -> ('b option, 'e) Mon.t) -> ('a, 'e) t -> ('b option, 'e) Mon.t
val iter2 : ('a -> 'b -> (unit, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t -> (unit, 'e) Mon.t
val fold_left2 : ('a -> 'b -> 'c -> ('a, 'e) Mon.t) -> 'a -> ('b, 'e) t -> ('c, 'e) t -> ('a, 'e) Mon.t
val for_all2 : ('a -> 'b -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t -> (bool, 'e) Mon.t
val exists2 : ('a -> 'b -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t -> (bool, 'e) Mon.t
val init : int -> (int -> ('a, 'e) Mon.t) -> ('a, 'e) t
val unfold : ('b -> (('a * 'b) option, 'e) Mon.t) -> 'b -> ('a, 'e) t
val forever : (unit -> ('a, 'e) Mon.t) -> ('a, 'e) t
val iterate : ('a -> ('a, 'e) Mon.t) -> 'a -> ('a, 'e) t
val map : ('a -> ('b, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t
val mapi : (int -> 'a -> ('b, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t
val filter : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('a, 'e) t
val filter_map : ('a -> ('b option, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t
val scan : ('b -> 'a -> ('b, 'e) Mon.t) -> 'b -> ('a, 'e) t -> ('b, 'e) t
val take_while : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('a, 'e) t
val drop_while : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('a, 'e) t
val group : ('a -> 'a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> (('a, 'e) t, 'e) t
val map2 : ('a -> 'b -> ('c, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t -> ('c, 'e) t
val map_product : ('a -> 'b -> ('c, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t -> ('c, 'e) t
val partition_map : ('a -> (('b, 'c) Either.t, 'e) Mon.t) -> ('a, 'e) t -> ('b, 'e) t * ('c, 'e) t
val partition : ('a -> (bool, 'e) Mon.t) -> ('a, 'e) t -> ('a, 'e) t * ('a, 'e) t
OCaml

Innovation. Community. Security.