Prelude.SeqFunctional Iterators
include module type of struct include Stdlib.Seq endtype !'a t = unit -> 'a nodeval is_empty : 'a t -> boolval iter : ('a -> unit) -> 'a t -> unitval fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'aval iteri : (int -> 'a -> unit) -> 'a t -> unitval fold_lefti : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'bval for_all : ('a -> bool) -> 'a t -> boolval exists : ('a -> bool) -> 'a t -> boolval find : ('a -> bool) -> 'a t -> 'a optionval find_map : ('a -> 'b option) -> 'a t -> 'b optionval empty : 'a tval return : 'a -> 'a tval init : int -> (int -> 'a) -> 'a tval unfold : ('b -> ('a * 'b) option) -> 'b -> 'a tval repeat : 'a -> 'a tval forever : (unit -> 'a) -> 'a tval iterate : ('a -> 'a) -> 'a -> 'a tval of_dispenser : (unit -> 'a option) -> 'a tval to_dispenser : 'a t -> unit -> 'a optionval ints : int -> int tval length : 'a t -> int(length xs) is the length of the sequence xs; tail recursive.
The traversal happens immediately and will not terminate on infinite sequences.
val len : 'a t -> intlen is length.
val foldl : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'afoldl is Seq.fold_left.
(index ?z xs) is a sequence of pairs; the fst's of the pairs are successive integers (starting from z (default: 0) and the snd's of the pairs are the elements of xs.
val to_list : 'a t -> 'a list(to_list xs) is the list consisting of the elements of the sequence xs.
The traversal happens immediately and will not terminate on infinite sequences.
val of_lines : Stdlib.in_channel -> string tval of_chars : Stdlib.in_channel -> char tval random : ?size:(unit -> int) -> (unit -> 'a) -> unit -> 'a t(random ?size r ()) is a random sequence of size (size ()) (default: < 100) elements given by (r ()).