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

See the documentation of Sigs1.SEQMON1TRANSFORMERS 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.

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