TaskSeq Type
Static members
| Static member |
Description
|
||||
|
Concatenates task sequences source1 and source2 in order as a single task sequence.
|
||||
|
Concatenates a task sequence source1 with a (non-async) F# seq in source2 and returns a single task sequence.
|
||||
|
Views each item in the input task sequence as obj, boxing value types.
|
||||
|
Casts each item in the untyped input task sequence. If the input sequence contains value types it is recommended to consider using unbox instead.
|
||||
|
Applies the given function chooser to each element of the task sequence. Returns a sequence comprised of the results where the function returns Some(x). If chooser is asynchronous, consider using chooseAsync.
|
||||
|
|
||||
|
Divides the input task sequence into chunks of size at most chunkSize. The last chunk may be smaller than chunkSize if the source sequence does not divide evenly. Returns an empty task sequence when the source is empty. If chunkSize is not positive, an ArgumentException is raised immediately (before the sequence is evaluated).
|
||||
|
Builds a new task sequence whose elements are the results of applying the binder function to each of the elements of the input task sequence in source, and concatenating the returned task sequences. The given function will be applied as elements are pulled using async enumerators retrieved from the input task sequence. If binder is asynchronous, consider using collectAsync.
|
||||
Full Usage:
TaskSeq.collectAsync binder source
Parameters:
'T -> 'a
-
An asynchronous function to transform items from the input task sequence into a task sequence.
source : TaskSeq<'T>
-
The input task sequence.
Returns: TaskSeq<'U>
The resulting concatenation of all returned task sequences.
|
Builds a new task sequence whose elements are the results of applying the asynchronous binder function to each of the elements of the input task sequence in source, and concatenating the returned task sequences. The given function will be applied as elements are pulled using async enumerators retrieved from the input task sequence. If binder is synchronous, consider using collect.
|
||||
|
Builds a new task sequence whose elements are the results of applying the binder function to each of the elements of the input task sequence in source, and concatenating the returned regular F# sequences. The given function will be applied as elements are pulled using async enumerators retrieved from the input task sequence. If binder is asynchronous, consider using collectSeqAsync.
|
||||
Full Usage:
TaskSeq.collectSeqAsync binder source
Parameters:
'T -> 'a
-
An asynchronous function to transform items from the input task sequence into a regular sequence.
source : TaskSeq<'T>
-
The input task sequence.
Returns: TaskSeq<'U>
The resulting concatenation of all returned task sequences.
|
Builds a new task sequence whose elements are the results of applying the asynchronous binder function to each of the elements of the input task sequence in source, and concatenating the returned regular F# sequences. The given function will be applied as elements are pulled using async enumerators retrieved from the input task sequence. If binder is synchronous, consider using collectSeqAsync.
|
||||
Full Usage:
TaskSeq.compareWith comparer source1 source2
Parameters:
'T -> 'T -> int
-
A function that compares an element from the first sequence with one from the second, returning an integer (negative = less than, zero = equal, positive = greater than).
source1 : TaskSeq<'T>
-
The first input task sequence.
source2 : TaskSeq<'T>
-
The second input task sequence.
Returns: Task<int>
A task returning the first non-zero comparison result, or zero if all elements compare equal and the sequences have equal length.
|
Applies a comparer function to corresponding elements of two task sequences, returning the result of the first comparison that is non-zero, or zero if all compared elements are equal. The sequences are compared element by element until one of them is exhausted; if one sequence is shorter than the other, it is considered less than the longer sequence. If the comparer function comparer is asynchronous, consider using compareWithAsync.
|
||||
Full Usage:
TaskSeq.compareWithAsync comparer source1 source2
Parameters:
'T -> 'T -> 'a
-
An asynchronous function that compares an element from the first sequence with one from the second, returning an integer (negative = less than, zero = equal, positive = greater than).
source1 : TaskSeq<'T>
-
The first input task sequence.
source2 : TaskSeq<'T>
-
The second input task sequence.
Returns: Task<int>
A task returning the first non-zero comparison result, or zero if all elements compare equal and the sequences have equal length.
|
Applies an asynchronous comparer function to corresponding elements of two task sequences, returning the result of the first comparison that is non-zero, or zero if all compared elements are equal. The sequences are compared element by element until one of them is exhausted; if one sequence is shorter than the other, it is considered less than the longer sequence. If the comparer function comparer is synchronous, consider using compareWith.
|
||||
|
Combines the given task sequence of resizable arrays and concatenates them end-to-end, to form a new flattened, single task sequence.
|
||||
|
Combines the given task sequence of lists and concatenates them end-to-end, to form a new flattened, single task sequence.
|
||||
|
Combines the given task sequence of arrays and concatenates them end-to-end, to form a new flattened, single task sequence.
|
||||
|
Combines the given task sequence of sequences and concatenates them end-to-end, to form a new flattened, single task sequence.
|
||||
|
Combines the given task sequence of task sequences and concatenates them end-to-end, to form a new flattened, single task sequence, like TaskSeq.collect id. Each task sequence is awaited and consumed in full, before the next one is iterated.
|
||||
|
|
||||
|
Applies a key-generating function to each element of a task sequence and returns a task with an array of unique keys and their element counts, in order of first occurrence of each key. This function consumes the entire source task sequence before returning. If the projection function projection is asynchronous, consider using countByAsync.
|
||||
|
Applies an asynchronous key-generating function to each element of a task sequence and returns a task with an array of unique keys and their element counts, in order of first occurrence of each key. This function consumes the entire source task sequence before returning. If the projection function projection is synchronous, consider using countBy.
|
||||
|
|||||
|
Returns a new task sequence that contains no duplicate entries, using generic hash and equality comparisons. If an element occurs multiple times in the sequence, only the first occurrence is returned. This function iterates the whole sequence and buffers all unique elements in a hash set, so it should not be used on potentially infinite sequences.
|
||||
Full Usage:
TaskSeq.distinctBy projection source
Parameters:
'T -> 'Key
-
A function that transforms each element to a key that is used for equality comparison.
source : TaskSeq<'T>
-
The input task sequence.
Returns: TaskSeq<'T>
A sequence with elements whose projected keys are distinct.
|
Returns a new task sequence that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given projection function. If two elements have the same projected key, only the first occurrence is returned. If the projection function is asynchronous, consider using distinctByAsync. This function iterates the whole sequence and buffers all unique keys in a hash set, so it should not be used on potentially infinite sequences.
|
||||
Full Usage:
TaskSeq.distinctByAsync projection source
Parameters:
'T -> 'a
-
An asynchronous function that transforms each element to a key used for equality comparison.
source : TaskSeq<'T>
-
The input task sequence.
Returns: TaskSeq<'T>
A sequence with elements whose projected keys are distinct.
|
Returns a new task sequence that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given asynchronous projection function. If two elements have the same projected key, only the first occurrence is returned. If the projection function is synchronous, consider using distinctBy. This function iterates the whole sequence and buffers all unique keys in a hash set, so it should not be used on potentially infinite sequences.
|
||||
|
Returns a new task sequence without consecutive duplicate elements.
|
||||
|
|
||||
|
Returns the only element of the task sequence.
|
||||
Full Usage:
TaskSeq.except itemsToExclude source
Parameters:
TaskSeq<'T>
-
A task sequence whose elements that also occur in the second sequence will cause those elements to be removed from the returned sequence.
source : TaskSeq<'T>
-
The input task sequence whose elements that are not also in the first will be returned.
Returns: TaskSeq<'T>
A sequence that contains the set difference of the elements of two sequences.
|
Returns a new task sequence with the distinct elements of the second task sequence which do not appear in the itemsToExclude sequence, using generic hash and equality comparisons to compare values. Note that this function returns a task sequence that digests the whole of the first input task sequence as soon as the resulting task sequence first gets awaited or iterated. As a result this function should not be used with large or infinite sequences in the first parameter. The function makes no assumption on the ordering of the first input sequence.
|
||||
Full Usage:
TaskSeq.exceptOfSeq itemsToExclude source
Parameters:
'T seq
-
A task sequence whose elements that also occur in the second sequence will cause those elements to be removed from the returned sequence.
source : TaskSeq<'T>
-
The input task sequence whose elements that are not also in first will be returned.
Returns: TaskSeq<'T>
A sequence that contains the set difference of the elements of two sequences.
|
Returns a new task sequence with the distinct elements of the second task sequence which do not appear in the itemsToExclude sequence, using generic hash and equality comparisons to compare values. Note that this function returns a task sequence that digests the whole of the first input task sequence as soon as the result sequence first gets awaited or iterated. As a result this function should not be used with large or infinite sequences in the first parameter. The function makes no assumption on the ordering of the first input sequence.
|
||||
|
|
||||
|
Tests if any element of the task sequence in source satisfies the given asynchronous predicate. The function is applied to the elements of the input task sequence. If any application returns true then the overall result is true and no further elements are evaluated and tested. Otherwise, false is returned.
|
||||
|
Returns a new task sequence containing only the elements of the collection for which the given function predicate returns true. If predicate is asynchronous, consider using filterAsync.
|
||||
|
|
||||
|
|
||||
|
|
||||
|
Returns the index, starting from zero, of the first element for which the given function predicate returns true. If predicate is asynchronous, consider using findIndexAsync.
|
||||
|
|
||||
|
then computes
|
||||
Full Usage:
TaskSeq.foldAsync folder state source
Parameters:
'State -> 'T -> 'a
-
A function that updates the state with each element from the sequence.
state : 'State
-
The initial state.
source : TaskSeq<'T>
-
The input sequence.
Returns: Task<'State>
The state object after the folding function is applied to each element of the sequence.
|
Applies the asynchronous function folder to each element in the task sequence, threading an accumulator argument of type 'State through the computation. If the input function is f and the elements are i0...iN then computes f (... (f s i0)...) iN. If the accumulator function folder is synchronous, consider using fold.
|
||||
Full Usage:
TaskSeq.forall predicate source
Parameters:
'T -> bool
-
A function to test an element of the input sequence.
source : TaskSeq<'T>
-
The input task sequence.
Returns: Task<bool>
A task that, after awaiting, holds true if every element of the sequence satisfies the predicate; false otherwise.
|
Tests if all elements of the sequence satisfy the given predicate. Stops evaluating as soon as predicate returns false. If predicate is asynchronous, consider using forallAsync.
|
||||
Full Usage:
TaskSeq.forallAsync predicate source
Parameters:
'T -> 'a
-
A function to test an element of the input sequence.
source : TaskSeq<'T>
-
The input task sequence.
Returns: Task<bool>
A task that, after awaiting, holds true if every element of the sequence satisfies the predicate; false otherwise.
|
|
||||
|
Applies a key-generating function to each element of a task sequence and yields a sequence of unique keys and arrays of all elements that have each key, in order of first occurrence of each key. The returned array preserves the original order of elements within each group. This function consumes the entire source task sequence before returning. If the projection function projection is asynchronous, consider using groupByAsync.
|
||||
|
Applies an asynchronous key-generating function to each element of a task sequence and yields a sequence of unique keys and arrays of all elements that have each key, in order of first occurrence of each key. The returned array preserves the original order of elements within each group. This function consumes the entire source task sequence before returning. If the projection function projection is synchronous, consider using groupBy.
|
||||
|
Returns the first element of the input task sequence given by source.
|
||||
|
Builds a new task sequence whose elements are the corresponding elements of the input task sequence source paired with the integer index (from 0) of each element.
|
||||
Full Usage:
TaskSeq.init count initializer
Parameters:
int
-
The maximum number of items to generate for the sequence.
initializer : int -> 'T
-
A function that generates an item in the sequence from a given index.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Generates a new task sequence which, when iterated, will return successive elements by calling the given function with the current zero-based index, up to the given count. Each element is saved after its initialization for successive access to Current, which will not re-evaluate the initializer. However, re-iterating the returned task sequence will re-evaluate the initialization function. The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
|
||||
Full Usage:
TaskSeq.initAsync count initializer
Parameters:
int
-
The maximum number of items to generate for the sequence.
initializer : int -> 'a
-
A function that generates an item in the sequence from a given index.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Generates a new task sequence which, when iterated, will return successive elements by calling the given function with the current zero-based index, up to the given count. Each element is saved after its initialization for successive access to Current, which will not re-evaluate the initializer. However, re-iterating the returned task sequence will re-evaluate the initialization function. The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
|
||||
Full Usage:
TaskSeq.initInfinite initializer
Parameters:
int -> 'T
-
A function that generates an item in the sequence from a given index.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Generates a new task sequence which, when iterated, will return successive elements by calling the given function with the current zero-based index, ad infinitum, or until MaxValue is reached. Each element is saved after its initialization for successive access to Current, which will not re-evaluate the initializer. However, re-iterating the returned task sequence will re-evaluate the initialization function. The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
|
||||
Full Usage:
TaskSeq.initInfiniteAsync initializer
Parameters:
int -> 'a
-
A function that generates an item in the sequence from a given index.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Generates a new task sequence which, when iterated, will return successive elements by calling the given function with the current zero-based index, ad infinitum, or until MaxValue is reached. Each element is saved after its initialization for successive access to Current, which will not re-evaluate the initializer. However, re-iterating the returned task sequence will re-evaluate the initialization function. The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
|
||||
|
Return a new task sequence with a new item inserted before the given index.
|
||||
|
Return a new task sequence with the new items inserted before the given index.
|
||||
|
|
||||
|
Returns the nth element of the input task sequence given by source, or raises an exception if the sequence does not contain enough elements. The index is zero-based, that is, using index 0 returns the first element.
|
||||
|
Iterates over the input task sequence, applying the action function to each item. This function is non-blocking, but will exhaust the full input sequence as soon as the task is evaluated.
|
||||
|
Iterates over the input task sequence, applying the asynchronous action function to each item. This function is non-blocking, but will exhaust the full input sequence as soon as the task is evaluated.
|
||||
|
Iterates over the input task sequence, applying the action function to each item, supplying the zero-based index as extra parameter for the action function. This function is non-blocking, but will exhaust the full input sequence as soon as the task is evaluated.
|
||||
|
Iterates over the input task sequence, applying the asynchronous action function to each item, supplying the zero-based index as extra parameter for the action function. This function is non-blocking, but will exhaust the full input sequence as soon as the task is evaluated.
|
||||
|
Returns the last element of the input task sequence given by source.
|
||||
|
Returns the length of the sequence. This operation requires the whole sequence to be evaluated and should not be used on potentially infinite sequences, see lengthOrMax for an alternative.
|
||||
|
Returns the length of the sequence of all items for which the predicate returns true. This operation requires the whole sequence to be evaluated and should not be used on potentially infinite sequences. If predicate is asynchronous, consider using lengthByAsync.
|
||||
|
Returns the length of the sequence of all items for which the predicate returns true. This operation requires the whole sequence to be evaluated and should not be used on potentially infinite sequences. If predicate is synchronous, consider using lengthBy.
|
||||
|
Returns the length of the sequence, or max, whichever comes first. This operation requires the task sequence to be evaluated ether in full, or until max items have been processed. Use this method instead of length if you need to limit the number of items evaluated, or if the sequence is potentially infinite.
|
||||
|
Builds a new task sequence whose elements are the results of applying the mapper function to each of the elements of the input task sequence in source. The given function will be applied as elements are pulled using async enumerators retrieved from the input task sequence. If mapper is asynchronous, consider using mapAsync.
|
||||
|
Builds a new task sequence whose elements are the results of applying the asynchronous mapper function to each of the elements of the input task sequence in source. The given function will be applied as elements are pulled using async enumerators retrieved from the input task sequence. If mapper is synchronous, consider using map.
|
||||
Full Usage:
TaskSeq.mapFold mapping state source
Parameters:
'State -> 'T -> 'Result * 'State
-
A function that maps each element to a result while also updating the state.
state : 'State
-
The initial state.
source : TaskSeq<'T>
-
The input task sequence.
Returns: Task<'Result[] * 'State>
A task returning a pair of the array of mapped results and the final state.
|
Applies the function mapping to each element of the task sequence, threading an accumulator argument through the computation, while also generating a new mapped element for each input element. If the input function is f and the elements are i0...iN, then computes both the mapped results r0...rN and the final state in a single pass. The result is a pair of an array of mapped values and the final state. If the mapping function mapping is asynchronous, consider using mapFoldAsync.
|
||||
Full Usage:
TaskSeq.mapFoldAsync mapping state source
Parameters:
'State -> 'T -> 'a
-
An asynchronous function that maps each element to a result while also updating the state.
state : 'State
-
The initial state.
source : TaskSeq<'T>
-
The input task sequence.
Returns: Task<'Result[] * 'State>
A task returning a pair of the array of mapped results and the final state.
|
Applies the asynchronous function mapping to each element of the task sequence, threading an accumulator argument through the computation, while also generating a new mapped element for each input element. If the input function is f and the elements are i0...iN, then computes both the mapped results r0...rN and the final state in a single pass. The result is a pair of an array of mapped values and the final state. If the mapping function mapping is synchronous, consider using mapFold.
|
||||
|
Builds a new task sequence whose elements are the results of applying the mapper function to each of the elements of the input task sequence in source, passing an extra zero-based index argument to the mapper function. The given function will be applied as elements are pulled using the MoveNextAsync method on async enumerators retrieved from the input task sequence. Does not evaluate the input sequence until requested.
|
||||
|
Builds a new task sequence whose elements are the results of applying the asynchronous mapper function to each of the elements of the input task sequence in source, passing an extra zero-based index argument to the mapper function. The given function will be applied as elements are pulled using the MoveNextAsync method on async enumerators retrieved from the input task sequence. Does not evaluate the input sequence until requested.
|
||||
|
Returns the greatest of all elements of the sequence, compared via max.
|
||||
|
Returns the greatest of all elements of the task sequence, compared via max on the result of applying the function projection to each element. If projection is asynchronous, consider using maxByAsync.
|
||||
|
|
||||
|
Returns the smallest of all elements of the sequence, compared via min.
|
||||
|
Returns the smallest of all elements of the task sequence, compared via min on the result of applying the function projection to each element. If projection is asynchronous, consider using minByAsync.
|
||||
|
|
||||
Full Usage:
TaskSeq.ofArray source
Parameters:
'T[]
-
The input array.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given array as a task sequence, that is, as an IAsyncEnumerable<'T>.
|
||||
|
Views the given array of Asyncs as a task sequence, that is, as an IAsyncEnumerable<'T>. An array of asyncs is not the same as a task sequence. Each async computation in an array of asyncs can be run individually or in parallel, potentially with overlapping side effects, while a task sequence forces awaiting between the items in the sequence, preventing such overlap to happen.
|
||||
|
Views the given list of Asyncs as a task sequence, that is, as an IAsyncEnumerable<'T>. A list of asyncs is not the same as a task sequence. Each async computation in a list of asyncs can be run individually or in parallel, potentially with overlapping side effects, while a task sequence forces awaiting between the items in the sequence, preventing such overlap to happen.
|
||||
|
Views the given seq of Asyncs as a task sequence, that is, as an IAsyncEnumerable<'T>. A sequence of asyncs is not the same as a task sequence. Each async computation in a sequence of asyncs can be run individually or in parallel, potentially with overlapping side effects, while a task sequence forces awaiting between the items in the sequence, preventing such overlap to happen.
|
||||
Full Usage:
TaskSeq.ofList source
Parameters:
'T list
-
The input list.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given list as a task sequence, that is, as an IAsyncEnumerable<'T>.
|
||||
Full Usage:
TaskSeq.ofResizeArray source
Parameters:
ResizeArray<'T>
-
The input resize array.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given resizable array as a task sequence, that is, as an IAsyncEnumerable<'T>.
|
||||
Full Usage:
TaskSeq.ofSeq source
Parameters:
'T seq
-
The input sequence.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given seq as a task sequence, that is, as an IAsyncEnumerable<'T>.
|
||||
Full Usage:
TaskSeq.ofTaskArray source
Parameters:
'a array
-
The input array-of-tasks.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given array of Tasks as a task sequence, that is, as an IAsyncEnumerable<'T>. An array of tasks will typically already be hot-started, as a result, each task can already run and potentially out of order, or with overlapping side effects, while a task sequence forces awaiting between the items in the sequence, preventing such overlap to happen. Converting an array of tasks into a task sequence is no guarantee that overlapping side effects are prevented. Safe for side-effect free tasks.
|
||||
Full Usage:
TaskSeq.ofTaskList source
Parameters:
'a list
-
The input list-of-tasks.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given list of Tasks as a task sequence, that is, as an IAsyncEnumerable<'T>. A list of tasks will typically already be hot-started, as a result, each task can already run and potentially out of order, or with overlapping side effects, while a task sequence forces awaiting between the items in the sequence, preventing such overlap to happen. Converting a list of tasks into a task sequence is no guarantee that overlapping side effects are prevented. Safe for side-effect free tasks.
|
||||
Full Usage:
TaskSeq.ofTaskSeq source
Parameters:
'a seq
-
The input sequence-of-tasks.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Views the given seq of Tasks as a task sequence, that is, as an IAsyncEnumerable<'T>. A sequence of tasks is not the same as a task sequence. Each task in a sequence of tasks can be run individually and potentially out of order, or with overlapping side effects, while a task sequence forces awaiting between the items in the sequence, preventing such overlap to happen.
|
||||
|
Returns a task sequence of each element in the source paired with its successor. The sequence is empty if the source has fewer than two elements.
|
||||
|
Splits the task sequence into two arrays: those for which the given predicate returns This function consumes the entire source task sequence before returning. If the predicate function predicate is asynchronous, consider using partitionAsync.
|
||||
Full Usage:
TaskSeq.partitionAsync predicate source
Parameters:
'T -> 'a
-
An asynchronous function that returns true for elements to include in the first array.
source : TaskSeq<'T>
-
The input task sequence.
Returns: Task<'T[] * 'T[]>
A task returning a tuple of two arrays: (trueItems, falseItems).
|
Splits the task sequence into two arrays using an asynchronous predicate: those for which the predicate returns
This function consumes the entire source task sequence before returning. If the predicate function predicate is synchronous, consider using partition.
|
||||
|
|
||||
|
|
||||
|
Concatenates a (non-async) F# seq in source1 with a task sequence in source2 and returns a single task sequence.
|
||||
|
Applies the function folder to each element of the task sequence, threading an accumulator argument through the computation. The first element is used as the initial state. If the input function is f and the elements are i0...iN, then computes f (... (f i0 i1)...) iN. Raises ArgumentException when the sequence is empty. If the accumulator function folder is asynchronous, consider using reduceAsync.
|
||||
|
Applies the asynchronous function folder to each element of the task sequence, threading an accumulator argument through the computation. The first element is used as the initial state. If the input function is f and the elements are i0...iN, then computes f (... (f i0 i1)...) iN. Raises ArgumentException when the sequence is empty. If the accumulator function folder is synchronous, consider using reduce.
|
||||
|
Return a new task sequence with the item at the given index removed.
|
||||
|
Return a new task sequence with the number of items starting at a given index removed. If count is negative or zero, no items are removed. If index + count is greater than source length, but index is not, then all items until end of sequence are removed.
|
||||
Full Usage:
TaskSeq.replicate count value
Parameters:
int
-
The number of times to replicate the value.
value : 'T
-
The value to replicate.
Returns: TaskSeq<'T>
A task sequence containing count copies of value.
|
Creates a task sequence by replicating value a total of count times.
|
||||
Full Usage:
TaskSeq.scan folder state source
Parameters:
'State -> 'T -> 'State
-
A function that updates the state with each element from the sequence.
state : 'State
-
The initial state.
source : TaskSeq<'T>
-
The input sequence.
Returns: TaskSeq<'State>
A task sequence of states, starting with the initial state and applying the folder to each element.
|
Like fold, but returns the sequence of intermediate results and the final result.
The first element of the output sequence is always the initial state. If the input task sequence
has
|
||||
Full Usage:
TaskSeq.scanAsync folder state source
Parameters:
'State -> 'T -> 'a
-
A function that updates the state with each element from the sequence.
state : 'State
-
The initial state.
source : TaskSeq<'T>
-
The input sequence.
Returns: TaskSeq<'State>
A task sequence of states, starting with the initial state and applying the folder to each element.
|
Like foldAsync, but returns the sequence of intermediate results and the final result.
The first element of the output sequence is always the initial state. If the input task sequence
has
|
||||
Full Usage:
TaskSeq.singleton value
Parameters:
'T
-
The input item to use as the single item of the task sequence.
Returns: TaskSeq<'T>
|
Creates a task sequence from value that generates a single element and then ends.
|
||||
|
|
||||
|
Returns a task sequence that, when iterated, skips elements of the underlying sequence while the given function predicate returns true, and then yields the remaining elements. Elements where the predicate returns false are propagated, which means that this function may not skip any elements (see also skipWhileInclusive). If predicate is asynchronous, consider using skipWhileAsync.
|
||||
|
Returns a task sequence that, when iterated, skips elements of the underlying sequence while the given asynchronous function predicate returns true, and then yields the remaining elements. Elements where the predicate returns false are propagated, which means that this function may not skip any elements (see also skipWhileInclusiveAsync). If predicate is synchronous, consider using skipWhile.
|
||||
|
Returns a task sequence that, when iterated, skips elements of the underlying sequence until the given function predicate returns false, also skips that element and then yields the remaining elements (see also skipWhile). It will thus always skip at least one element of a non-empty sequence, or returns the empty task sequence if the input is empty. If predicate is asynchronous, consider using skipWhileInclusiveAsync.
|
||||
|
Returns a task sequence that, when iterated, skips elements of the underlying sequence until the given function predicate returns false, also skips that element and then yields the remaining elements (see also skipWhileAsync). It will thus always skip at least one element of a non-empty sequence, or returns the empty task sequence if the input is empty. If predicate is synchronous, consider using skipWhileInclusive.
|
||||
|
Returns the whole task sequence from source, minus its first element.
|
||||
|
Returns a task sequence that, when iterated, yields count elements of the underlying sequence, and then returns no further elements. Raises an exception if there are not enough elements in the sequence. See truncate for a version that does not raise an exception. See also skip for the inverse of this operation.
|
||||
|
Returns a task sequence that, when iterated, yields elements of the underlying sequence while the
given function predicate returns true, and then returns no further elements.
Stops consuming the source and yielding items as soon as the predicate returns
|
||||
|
Returns a task sequence that, when iterated, yields elements of the underlying sequence while the
given asynchronous function predicate returns true, and then returns no further elements.
Stops consuming the source and yielding items as soon as the predicate returns
|
||||
|
Returns a task sequence that, when iterated, yields elements of the underlying sequence until the given function predicate returns false, returns that element and then returns no further elements (see also takeWhile). This function returns at least one element of a non-empty sequence, or the empty task sequence if the input is empty. If predicate is asynchronous, consider using takeWhileInclusiveAsync.
|
||||
|
Returns a task sequence that, when iterated, yields elements of the underlying sequence until the given asynchronous function predicate returns false, returns that element and then returns no further elements (see also takeWhileAsync). This function returns at least one element of a non-empty sequence, or the empty task sequence if the input is empty. If predicate is synchronous, consider using takeWhileInclusive.
|
||||
Full Usage:
TaskSeq.toArray source
Parameters:
TaskSeq<'T>
-
The input task sequence.
Returns: 'T[]
The resulting array.
|
Builds an array from the input task sequence in source. This function is blocking until the sequence is exhausted and will then properly dispose of the resources.
|
||||
|
Builds an array asynchronously from the input task sequence. This function is non-blocking while it builds the array.
|
||||
|
Builds an IList<'T> asynchronously from the input task sequence. This function is non-blocking while it builds the IList.
|
||||
Full Usage:
TaskSeq.toList source
Parameters:
TaskSeq<'T>
-
The input task sequence.
Returns: 'T list
The resulting list.
|
Builds an F# list from the input task sequence in source. This function is blocking until the sequence is exhausted and will then properly dispose of the resources.
|
||||
|
Builds an F# list asynchronously from the input task sequence. This function is non-blocking while it builds the list.
|
||||
|
Gathers items into a ResizeArray (see List<_>) asynchronously from the input task sequence. This function is non-blocking while it builds the resizable array.
|
||||
Full Usage:
TaskSeq.toSeq source
Parameters:
TaskSeq<'T>
-
The input task sequence.
Returns: 'T seq
The resulting task sequence.
|
Views the task sequence in source as an F# seq, that is, an IEnumerable<_>. This function is blocking at each call to MoveNext() in the resulting sequence. Resources are disposed when the enumerator is disposed, or the enumerator is exhausted.
|
||||
|
|
||||
|
Returns the only element of the task sequence, or None if the sequence is empty of contains more than one element.
|
||||
|
Returns the first element for which the given function predicate returns true. Returns None if no such element exists. If predicate is asynchronous, consider using tryFindAsync.
|
||||
|
|
||||
|
Returns the index, starting from zero, for which the given function predicate returns true. Returns None if no such element exists. If predicate is asynchronous, consider using tryFindIndexAsync.
|
||||
|
Returns the index, starting from zero, for which the given asynchronous function predicate returns true. Returns None if no such element exists. If predicate is synchronous, consider using tryFindIndex.
|
||||
|
Returns the first element of the input task sequence given by source, or None if the sequence is empty.
|
||||
|
Returns the nth element of the input task sequence given by source, or None if the sequence does not contain enough elements. The index is zero-based, that is, using index 0 returns the first element.
|
||||
|
Returns the last element of the input task sequence given by source, or None if the sequence is empty.
|
||||
|
Applies the given function chooser to successive elements, returning the first result where the function returns Some(x). If chooser is asynchronous, consider using tryPickAsync.
|
||||
|
|
||||
|
Returns the whole input task sequence given by source, minus its first element, or None if the sequence is empty.
|
||||
|
Calls unbox on each item when the task sequence is consumed. The target type must be a value type.
|
||||
Full Usage:
TaskSeq.unfold generator state
Parameters:
'State -> ('T * 'State) option
-
A function that takes the current state and returns either None to terminate,
or Some(element, newState) to yield an element and continue with a new state.
state : 'State
-
The initial state value.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Returns a task sequence generated by applying the generator function to a state value, until it returns
|
||||
Full Usage:
TaskSeq.unfoldAsync generator state
Parameters:
'State -> Task<('T * 'State) option>
-
An async function that takes the current state and returns either None to terminate,
or Some(element, newState) to yield an element and continue with a new state.
state : 'State
-
The initial state value.
Returns: TaskSeq<'T>
The resulting task sequence.
|
Returns a task sequence generated by applying the asynchronous generator function to a state value, until it
returns
|
||||
|
Return a new task sequence with the item at a given index set to the new value.
|
||||
|
Returns a new task sequence containing only the elements of the collection for which the given function predicate returns true. If predicate is asynchronous, consider using whereAsync. Alias for filter.
|
||||
|
Returns a new task sequence containing only the elements of the input sequence for which the given function predicate returns true. If predicate is synchronous, consider using where. Alias for filterAsync.
|
||||
|
Returns a task sequence of sliding windows of a given size over the source sequence. Each window is a fresh array of exactly windowSize consecutive elements. The result is empty if the source has fewer than windowSize elements. Uses a ring buffer internally to avoid redundant copies, yielding one allocation per window. If windowSize is not positive, an ArgumentException is raised immediately (before the sequence is evaluated).
|
||||
Full Usage:
TaskSeq.withCancellation cancellationToken source
Parameters:
CancellationToken
-
The cancellation token to pass to GetAsyncEnumerator.
source : TaskSeq<'T>
-
The input task sequence.
Returns: TaskSeq<'T>
A task sequence that uses the given cancellationToken when iterated.
|
Returns a task sequence that, when iterated, passes the given cancellationToken to the
underlying IAsyncEnumerable<'T>. This is the equivalent of calling
The cancellationToken supplied to this function overrides any token that would otherwise
be passed to the enumerator. This is useful when consuming sequences from libraries such as Entity Framework,
which accept a CancellationToken through
|
||||
|
Combines the two task sequences into a new task sequence of pairs. The two sequences need not have equal lengths: when one sequence is exhausted any remaining elements in the other sequence are ignored.
|
||||
Full Usage:
TaskSeq.zip3 source1 source2 source3
Parameters:
TaskSeq<'T1>
-
The first input task sequence.
source2 : TaskSeq<'T2>
-
The second input task sequence.
source3 : TaskSeq<'T3>
-
The third input task sequence.
Returns: TaskSeq<'T1 * 'T2 * 'T3>
The result task sequence of triples.
|
Combines the three task sequences into a new task sequence of triples. The three sequences need not have equal lengths: when one sequence is exhausted any remaining elements in the other sequences are ignored.
|
FSharp.Control.TaskSeq