Additional operations on IEnumerator
Function or value | Description | ||
|
|||
Full Usage:
Enumerator.choose chooser e
Parameters:
'T -> 'U option
-
The function to apply to each triple of elements from the input Enumerators.
e : IEnumerator<'T>
-
The input Enumerator.
Returns: IEnumerator<'U>
A new Enumerator of values selected from the chooser function.
|
|
||
Full Usage:
Enumerator.concat sources
Parameters:
IEnumerator<IEnumerator<'b>>
-
The source Enumerator of Enumerators.
Returns: IEnumerator<'b>
A concatenated enumeration of the given Enumerator sources.
|
|
||
Full Usage:
Enumerator.filter predicate e
Parameters:
'T -> bool
-
The function to test the input elements.
e : IEnumerator<'T>
-
The input Enumerator.
Returns: IEnumerator<'T>
A new Enumerator yielding only elements that satsify the predicate.
|
|
||
Full Usage:
Enumerator.map f e
Parameters:
'a -> 'b
-
The function to apply.
e : IEnumerator<'a>
-
The input Enumerator.
Returns: IEnumerator<'b>
A new Enumerator of mapped elements.
|
|
||
Full Usage:
Enumerator.map2 f e1 e2
Parameters:
'a -> 'b -> 'c
-
The function to apply to each pair of elements from the input Enumerators.
e1 : IEnumerator<'a>
-
The first input Enumerator.
e2 : IEnumerator<'b>
-
The second input Enumerator.
Returns: IEnumerator<'c>
A new Enumerator of mapped elements.
|
Stops enumerating when either of the input Enumerators are finished enumerating.
|
||
Full Usage:
Enumerator.map3 f e1 e2 e3
Parameters:
'e -> 'f -> 'g -> 'h
-
The function to apply to each triple of elements from the input Enumerators.
e1 : IEnumerator<'e>
-
The first input Enumerator.
e2 : IEnumerator<'f>
-
The second input Enumerator.
e3 : IEnumerator<'g>
-
The third input Enumerator.
Returns: IEnumerator<'h>
A new Enumerator of mapped elements.
|
Stops enumerating when any of the input Enumerators are finished enumerating.
|
||
Full Usage:
Enumerator.mapi f e
Parameters:
int -> 'a -> 'b
-
The function to apply, which is given both the index and the element.
e : IEnumerator<'a>
-
The input Enumerator.
Returns: IEnumerator<'b>
A new Enumerator of mapped elements.
|
|
||
Full Usage:
Enumerator.mapi2 f e1 e2
Parameters:
int -> 'a -> 'b -> 'c
-
The function to apply to the index and each pair of elements from the input Enumerators.
e1 : IEnumerator<'a>
-
The first input Enumerator.
e2 : IEnumerator<'b>
-
The second input Enumerator.
Returns: IEnumerator<'c>
A new Enumerator of mapped elements.
|
Stops enumerating when either of the input Enumerators are finished enumerating.
|
||
Full Usage:
Enumerator.nth index e
Parameters:
int
-
The index to retrieve.
e : IEnumerator<'T>
-
The input Enumerator.
Returns: 'T
The value at the given index or an exception is thrown if not found.
|
This is called
|
||
|
|||
Full Usage:
Enumerator.tryItem index e
Parameters:
int
-
The index to retrieve.
e : IEnumerator<'T>
-
The input Enumerator.
Returns: 'T option
The value at the given index or None if not found.
|
|
||
Full Usage:
Enumerator.unfold generator initialState
Parameters:
'a -> ('b * 'a) option
-
The function that takes the current state and returns an
option tuple of the next element of the list and the next state value.
initialState : 'a
-
The intitial state value.
Returns: IEnumerator<'b>
A new Enumerator yielding only elements that satsify the predicate.
|
|
||
Full Usage:
Enumerator.upto lastOption f
Parameters:
int option
-
The last index to stop at -- or None to run forever, well as far as Int32.MaxValue.
f : int -> 'U
-
The function to apply to each index.
Returns: IEnumerator<'U>
An enumerator that yields upto the lastOption.
|
The Current value for a valid index is "f i". Lazy<_> values are used as caches, to store either the result or an exception if thrown. These "Lazy<_>" caches are created only on the first call to current and forced immediately. The lazy creation of the cache nodes means enumerations that skip many Current values are not delayed by GC. For example, the full enumeration of Seq.initInfinite in the tests.
|
||
Full Usage:
Enumerator.zip e1 e2
Parameters:
IEnumerator<'a>
-
The first input Enumerator.
e2 : IEnumerator<'b>
-
The second input Enumerator.
Returns: IEnumerator<'a * 'b>
An Enumerator that enumerates pairs of two input Enumerators.
|
|
||
Full Usage:
Enumerator.zip3 e1 e2 e3
Parameters:
IEnumerator<'a>
-
The first input Enumerator.
e2 : IEnumerator<'b>
-
The second input Enumerator.
e3 : IEnumerator<'c>
-
The third input Enumerator.
Returns: IEnumerator<'a * 'b * 'c>
An Enumerator that enumerates triples of three input Enumerators.
|
|