Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
Interface for Python values of type Iter
.
val check : Object.t -> bool
check o
returns true
if o
is an iterator.
next i
returns the next value from the iteration i
. If there are no remaining values, returns None
. Wrapper for PyIter_Next.
iter f i
iteratively calls f v
with all the remaining values of the iteration i
.
to_list i
returns the list of all the remaining values from the iteration i
.
to_list_map f i
returns the list of the results of f
applied to all the remaining values from the iteration i
. to_list_map f s
is equivalent to List.map f (to_list s)
but is tail-recursive and f
is applied to the elements of s
in the reverse order.
val of_seq : Object.t Stdcompat.Seq.t -> Object.t
of_seq s
returns an interator that iterates over the values of the sequence s
.
val of_seq_map : ('a -> Object.t) -> 'a Stdcompat.Seq.t -> Object.t
of_seq_map f s
returns an interator that iterates over the results of f
applied to the values of the sequence s
. Py.Iter.of_seq_map f s
is equivalent to Py.Iter.of_seq (Seq.map f s)
.
val to_seq : Object.t -> Object.t Stdcompat.Seq.t
to_seq i
returns the sequence of the values from the iteration i
. The Python iteration is consumed while the sequence is browsed. Values are memoized, so that the sequence can be browsed many times.
val to_seq_map : (Object.t -> 'a) -> Object.t -> 'a Stdcompat.Seq.t
to_seq_map f i
returns the sequence of the results of f
applied to the values from the iteration i
. The Python iteration is consumed while the sequence is browsed. Values are memoized, so that the sequence can be browsed many times.
val unsafe_to_seq : Object.t -> Object.t Stdcompat.Seq.t
unsafe_to_seq i
returns the sequence of the values from the iteration i
. The Python iteration is consumed while the sequence is browsed. Warning: values are not memoized, so that the sequence can be browsed only once.
val unsafe_to_seq_map : (Object.t -> 'a) -> Object.t -> 'a Stdcompat.Seq.t
unsafe_to_seq_map f i
returns the sequence of the results of f
applied to the values from the iteration i
. The Python iteration is consumed while the sequence is browsed. Warning: values are not memoized, so that the sequence can be browsed only once.
of_list l
returns an interator that iterates over the values of the list l
.
of_list_map f l
returns an interator that iterates over the results of f
applied to the values of the list l
. Py.Iter.of_list_map f s
is equivalent to Py.Iter.of_list (List.map f s)
but is tail-recursive.
fold_left f v i
returns (f (...(f v i1)...) in)
where i1
, ..., in
are the remaining values from the iteration i
.
fold_right f i v
returns (f i1 (...(f v in)...)
where i1
, ..., in
are the remaining values from the iteration i
. This function is not tail-recursive.
for_all p i
checks if p
holds for all the remaining values from the iteration i
.
exists p i
checks if p
holds for at least one of the remaining values from the iteration i
.
Wrapper for PySeqIter_New
Wrapper for PyCallIter_New