module Sequence:sig..end
Sequence.persistent
function is provided, storing elements of a transient iterator
in memory; the iterator can then be used several times.
Note that some combinators also return sequences (e.g. Sequence.group). The
transformation is computed on the fly every time one iterates over
the resulting sequence. If a transformation performs heavy computation,
Sequence.persistent can also be used as intermediate storage.
type'at =('a -> unit) -> unit
'a.type('a, 'b)t2 =('a -> 'b -> unit) -> unit
'a and 'b.val from_iter : (('a -> unit) -> unit) -> 'a tval from_fun : (unit -> 'a option) -> 'a tSequence.persistent if needed!val empty : 'a tval singleton : 'a -> 'a tval repeat : 'a -> 'a tval iterate : ('a -> 'a) -> 'a -> 'a titerate f x is the infinite sequence (x, f(x), f(f(x)), ...)val forever : (unit -> 'b) -> 'b tval cycle : 'a t -> 'a tval iter : ('a -> unit) -> 'a t -> unitval iteri : (int -> 'a -> unit) -> 'a t -> unitval fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'bval foldi : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'bval map : ('a -> 'b) -> 'a t -> 'b tval mapi : (int -> 'a -> 'b) -> 'a t -> 'b tval for_all : ('a -> bool) -> 'a t -> boolval exists : ('a -> bool) -> 'a t -> boolval length : 'a t -> intval is_empty : 'a t -> boolval filter : ('a -> bool) -> 'a t -> 'a tval append : 'a t -> 'a t -> 'a tval concat : 'a t t -> 'a tval flatten : 'a t t -> 'a tSequence.concatval flatMap : ('a -> 'b t) -> 'a t -> 'b tconcat.val intersperse : 'a -> 'a t -> 'a tval persistent : 'a t -> 'a tval sort : ?cmp:('a -> 'a -> int) -> 'a t -> 'a tval sort_uniq : ?cmp:('a -> 'a -> int) -> 'a t -> 'a tsortval group : ?eq:('a -> 'a -> bool) -> 'a t -> 'a list tval uniq : ?eq:('a -> 'a -> bool) -> 'a t -> 'a tfun seq -> map List.hd (group seq).val product : 'a t -> 'b t -> ('a * 'b) tpersistent on it, so that it can be traversed
several times (outer loop of the product)val join : join_row:('a -> 'b -> 'c option) ->
'a t -> 'b t -> 'c tjoin ~join_row a b combines every element of a with every
element of b using join_row. If join_row returns None, then
the two elements do not combine. Assume that b allows for multiple
iterations.val unfoldr : ('b -> ('a * 'b) option) -> 'b -> 'a tunfoldr f b will apply f to b. If it
yields Some (x,b') then x is returned
and unfoldr recurses with b'.val scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b tval max : ?lt:('a -> 'a -> bool) -> 'a t -> 'a -> 'aval min : ?lt:('a -> 'a -> bool) -> 'a t -> 'a -> 'aval take : int -> 'a t -> 'a tn elements from the sequenceval drop : int -> 'a t -> 'a tn first elements of the sequenceval rev : 'a t -> 'a tval empty2 : ('a, 'b) t2val is_empty2 : ('a, 'b) t2 -> boolval length2 : ('a, 'b) t2 -> intval zip : ('a, 'b) t2 -> ('a * 'b) tval unzip : ('a * 'b) t -> ('a, 'b) t2val zip_i : 'a t -> (int, 'a) t2val fold2 : ('c -> 'a -> 'b -> 'c) -> 'c -> ('a, 'b) t2 -> 'cval iter2 : ('a -> 'b -> unit) -> ('a, 'b) t2 -> unitval map2 : ('a -> 'b -> 'c) -> ('a, 'b) t2 -> 'c tval map2_2 : ('a -> 'b -> 'c) ->
('a -> 'b -> 'd) -> ('a, 'b) t2 -> ('c, 'd) t2map2_2 f g seq2 maps each x, y of seq2 into f x y, g x yval to_list : 'a t -> 'a listval to_rev_list : 'a t -> 'a listval of_list : 'a list -> 'a tval to_array : 'a t -> 'a arrayval of_array : 'a array -> 'a tval of_array_i : 'a array -> (int * 'a) tval of_array2 : 'a array -> (int, 'a) t2val array_slice : 'a array -> int -> int -> 'a tarray_slice a i j Sequence of elements whose indexes range
from i to jval of_stream : 'a Stream.t -> 'a tval to_stream : 'a t -> 'a Stream.tval to_stack : 'a Stack.t -> 'a t -> unitval of_stack : 'a Stack.t -> 'a tStack.iter)val to_queue : 'a Queue.t -> 'a t -> unitval of_queue : 'a Queue.t -> 'a tval hashtbl_add : ('a, 'b) Hashtbl.t -> ('a * 'b) t -> unitval hashtbl_replace : ('a, 'b) Hashtbl.t -> ('a * 'b) t -> unitval to_hashtbl : ('a * 'b) t -> ('a, 'b) Hashtbl.tval to_hashtbl2 : ('a, 'b) t2 -> ('a, 'b) Hashtbl.tval of_hashtbl : ('a, 'b) Hashtbl.t -> ('a * 'b) tval of_hashtbl2 : ('a, 'b) Hashtbl.t -> ('a, 'b) t2val hashtbl_keys : ('a, 'b) Hashtbl.t -> 'a tval hashtbl_values : ('a, 'b) Hashtbl.t -> 'b tval of_str : string -> char tval to_str : char t -> stringval of_in_channel : Pervasives.in_channel -> char tval to_buffer : char t -> Buffer.t -> unitval int_range : start:int -> stop:int -> int tstart...stop by steps 1val of_set : (module Set.S with type elt = 'a and type t = 'b) -> 'b -> 'a tval to_set : (module Set.S with type elt = 'a and type t = 'b) -> 'a t -> 'bmodule Set:sig..end
module Map:sig..end
val random_int : int -> int tval random_bool : bool tval random_float : float -> float tval random_array : 'a array -> 'a tval random_list : 'a list -> 'a tmodule TypeClass:sig..end
module Infix:sig..end
val pp_seq : ?sep:string ->
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit'a, using the given pretty printer
to print each elements. An optional separator string can be provided.