package seqes

  1. Overview
  2. Docs

Other functions

Sequences also have functions that do not take any caller-provided function as arguments. For these functions, only the monad that the sequence is specialised to matters.

In addition to all those functions, the SEQMON1ALL module signature also includes the SEQMON1TRANSFORMERS module signature, but specialised with the type 'a callermon := 'a. All the functors that produce modules with this signature also produce all the transformers and traversors that operate with no caller monad.

type 'a mon

mon is the type constructor for the monad used in the sequence.

The type is meant to be substituted by the functor that produces modules of following this signature.

type 'a t

t is the type constructor for the sequence.

The type is meant to be substituted by the functor that produces modules of following this signature.

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) -> 'a t -> unit mon

See Stdlib.Seq.iter

val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a mon

See Stdlib.Seq.fold_left

val iteri : (int -> 'a -> unit) -> 'a t -> unit mon

See Stdlib.Seq.iteri

val fold_lefti : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b mon

See Stdlib.Seq.fold_lefti

val for_all : ('a -> bool) -> 'a t -> bool mon

See Stdlib.Seq.for_all

val exists : ('a -> bool) -> 'a t -> bool mon

See Stdlib.Seq.exists

val find : ('a -> bool) -> 'a t -> 'a option mon

See Stdlib.Seq.find

val find_map : ('a -> 'b option) -> 'a t -> 'b option mon

See Stdlib.Seq.find_map

val iter2 : ('a -> 'b -> unit) -> 'a t -> 'b t -> unit mon

See Stdlib.Seq.iter2

val fold_left2 : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b t -> 'c t -> 'a mon

See Stdlib.Seq.fold_left2

val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool mon

See Stdlib.Seq.for_all2

val exists2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool mon

See Stdlib.Seq.exists2

val init : int -> (int -> 'a) -> 'a t

See Stdlib.Seq.init

val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t

See Stdlib.Seq.unfold

val forever : (unit -> 'a) -> 'a t

See Stdlib.Seq.forever

val iterate : ('a -> 'a) -> 'a -> 'a t

See Stdlib.Seq.iterate

val map : ('a -> 'b) -> 'a t -> 'b t

See Stdlib.Seq.map

val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

See Stdlib.Seq.mapi

val filter : ('a -> bool) -> 'a t -> 'a t

See Stdlib.Seq.filter

val filter_map : ('a -> 'b option) -> 'a t -> 'b t

See Stdlib.Seq.filter_map

val scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t

See Stdlib.Seq.scan

val take_while : ('a -> bool) -> 'a t -> 'a t

See Stdlib.Seq.take_while

val drop_while : ('a -> bool) -> 'a t -> 'a t

See Stdlib.Seq.drop_while

val group : ('a -> 'a -> bool) -> 'a t -> 'a t t

See Stdlib.Seq.group

val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

See Stdlib.Seq.map2

val map_product : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

See Stdlib.Seq.map_product

val partition_map : ('a -> ('b, 'c) Stdlib.Either.t) -> 'a t -> 'b t * 'c t

See Stdlib.Seq.partition_map

val partition : ('a -> bool) -> 'a t -> 'a t * 'a t

See Stdlib.Seq.partition

val is_empty : 'a t -> bool mon

See Stdlib.Seq.is_empty

val uncons : 'a t -> ('a * 'a t) option mon

See Stdlib.Seq.uncons

val length : 'a t -> int mon

See Stdlib.Seq.length

val equal : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool mon

See Stdlib.Seq.equal

val compare : ('a -> 'b -> int) -> 'a t -> 'b t -> int mon

See Stdlib.Seq.compare

val empty : 'a t

See Stdlib.Seq.empty

val return : 'a -> 'a t

See Stdlib.Seq.return

val cons : 'a -> 'a t -> 'a t

See Stdlib.Seq.cons

val repeat : 'a -> 'a t

See Stdlib.Seq.repeat

val cycle : 'a t -> 'a t

See Stdlib.Seq.cycle

val take : int -> 'a t -> 'a t

See Stdlib.Seq.take

val drop : int -> 'a t -> 'a t

See Stdlib.Seq.drop

val memoize : 'a t -> 'a t

See Stdlib.Seq.memoize

val once : 'a t -> 'a t

See Stdlib.Seq.once

val transpose : 'a t t -> 'a t t

See Stdlib.Seq.transpose

val append : 'a t -> 'a t -> 'a t

See Stdlib.Seq.append

val concat : 'a t t -> 'a t

See Stdlib.Seq.concat

val flat_map : ('a -> 'b t) -> 'a t -> 'b t

See Stdlib.Seq.flat_map

val concat_map : ('a -> 'b t) -> 'a t -> 'b t

See Stdlib.Seq.concat_map

val zip : 'a t -> 'b t -> ('a * 'b) t

See Stdlib.Seq.zip

val interleave : 'a t -> 'a t -> 'a t

See Stdlib.Seq.interleave

val sorted_merge : ('a -> 'a -> int) -> 'a t -> 'a t -> 'a t

See Stdlib.Seq.sorted_merge

val product : 'a t -> 'b t -> ('a * 'b) t

See Stdlib.Seq.product

val unzip : ('a * 'b) t -> 'a t * 'b t

See Stdlib.Seq.unzip

val split : ('a * 'b) t -> 'a t * 'b t

See Stdlib.Seq.split

val of_dispenser : (unit -> 'a option mon) -> 'a t

See Stdlib.Seq.of_dispenser

val to_dispenser : 'a t -> unit -> 'a option mon

See Stdlib.Seq.to_dispenser

val ints : int -> int t

See Stdlib.Seq.ints

val of_seq : 'a Stdlib.Seq.t -> 'a t

See Stdlib.Seq.of_seq