Header menu logo FSharp.Control.TaskSeq

TaskSeq Type

Static members

Static member Description

TaskSeq.append source1 source2

Full Usage: TaskSeq.append source1 source2

Parameters:
    source1 : TaskSeq<'T> - The first input task sequence.
    source2 : TaskSeq<'T> - The second input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

Concatenates task sequences source1 and source2 in order as a single task sequence.

source1 : TaskSeq<'T>

The first input task sequence.

source2 : TaskSeq<'T>

The second input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when either of the input task sequences is null.

TaskSeq.appendSeq source1 source2

Full Usage: TaskSeq.appendSeq source1 source2

Parameters:
    source1 : TaskSeq<'T> - The input task sequence.
    source2 : 'T seq - The input F# seq sequence.

Returns: TaskSeq<'T> The resulting task sequence.

Concatenates a task sequence source1 with a (non-async) F# seq in source2 and returns a single task sequence.

source1 : TaskSeq<'T>

The input task sequence.

source2 : 'T seq

The input F# seq sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when either of the input sequences is null.

TaskSeq.box source

Full Usage: TaskSeq.box source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<obj> The resulting task sequence.

Views each item in the input task sequence as obj, boxing value types.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<obj>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.cast source

Full Usage: TaskSeq.cast source

Parameters:
    source : TaskSeq<obj> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

Casts each item in the untyped input task sequence. If the input sequence contains value types it is recommended to consider using unbox instead.

source : TaskSeq<obj>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.
InvalidCastException Thrown when the function is unable to cast an item to the target type.

TaskSeq.choose chooser source

Full Usage: TaskSeq.choose chooser source

Parameters:
    chooser : 'T -> 'U option - A function to transform items of type 'T into options of type 'U.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

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.

chooser : 'T -> 'U option

A function to transform items of type 'T into options of type 'U.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.chooseAsync chooser source

Full Usage: TaskSeq.chooseAsync chooser source

Parameters:
    chooser : 'T -> 'a - An asynchronous function to transform items of type 'T into options of type 'U.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

Applies the given asynchronous function chooser to each element of the task sequence. Returns a sequence comprised of the results where the function returns a task result of Some(x). If chooser is synchronous, consider using choose.

chooser : 'T -> 'a

An asynchronous function to transform items of type 'T into options of type 'U.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.chunkBySize chunkSize source

Full Usage: TaskSeq.chunkBySize chunkSize source

Parameters:
    chunkSize : int - The maximum number of elements in each chunk. Must be positive.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T[]> A task sequence of non-overlapping array chunks.

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).

chunkSize : int

The maximum number of elements in each chunk. Must be positive.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T[]>

A task sequence of non-overlapping array chunks.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when chunkSize is not positive.

TaskSeq.collect binder source

Full Usage: TaskSeq.collect binder source

Parameters:
    binder : 'T -> 'a - A 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 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.

binder : 'T -> 'a

A 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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.collectAsync binder source

Full Usage: TaskSeq.collectAsync binder source

Parameters:
    binder : '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.

binder : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.collectSeq binder source

Full Usage: TaskSeq.collectSeq binder source

Parameters:
    binder : 'T -> 'a - A 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 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.

binder : 'T -> 'a

A 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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.collectSeqAsync binder source

Full Usage: TaskSeq.collectSeqAsync binder source

Parameters:
    binder : '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.

binder : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.compareWith comparer source1 source2

Full Usage: TaskSeq.compareWith comparer source1 source2

Parameters:
    comparer : '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.

comparer : '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.

ArgumentNullException Thrown when either input task sequence is null.

TaskSeq.compareWithAsync comparer source1 source2

Full Usage: TaskSeq.compareWithAsync comparer source1 source2

Parameters:
    comparer : '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.

comparer : '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.

ArgumentNullException Thrown when either input task sequence is null.

TaskSeq.concat sources

Full Usage: TaskSeq.concat sources

Parameters:
    sources : TaskSeq<ResizeArray<'T>> - The input task sequence of resizable arrays.

Returns: TaskSeq<'T> The resulting, flattened task sequence.

Combines the given task sequence of resizable arrays and concatenates them end-to-end, to form a new flattened, single task sequence.

sources : TaskSeq<ResizeArray<'T>>

The input task sequence of resizable arrays.

Returns: TaskSeq<'T>

The resulting, flattened task sequence.

ArgumentNullException Thrown when the input task sequence of task sequences is null.

TaskSeq.concat sources

Full Usage: TaskSeq.concat sources

Parameters:
    sources : TaskSeq<'T list> - The input task sequence of lists.

Returns: TaskSeq<'T> The resulting, flattened task sequence.

Combines the given task sequence of lists and concatenates them end-to-end, to form a new flattened, single task sequence.

sources : TaskSeq<'T list>

The input task sequence of lists.

Returns: TaskSeq<'T>

The resulting, flattened task sequence.

ArgumentNullException Thrown when the input task sequence of task sequences is null.

TaskSeq.concat sources

Full Usage: TaskSeq.concat sources

Parameters:
    sources : TaskSeq<'T[]> - The input task sequence of arrays.

Returns: TaskSeq<'T> The resulting, flattened task sequence.

Combines the given task sequence of arrays and concatenates them end-to-end, to form a new flattened, single task sequence.

sources : TaskSeq<'T[]>

The input task sequence of arrays.

Returns: TaskSeq<'T>

The resulting, flattened task sequence.

ArgumentNullException Thrown when the input task sequence of task sequences is null.

TaskSeq.concat sources

Full Usage: TaskSeq.concat sources

Parameters:
    sources : TaskSeq<'T seq> - The input task sequence of sequences.

Returns: TaskSeq<'T> The resulting, flattened task sequence.

Combines the given task sequence of sequences and concatenates them end-to-end, to form a new flattened, single task sequence.

sources : TaskSeq<'T seq>

The input task sequence of sequences.

Returns: TaskSeq<'T>

The resulting, flattened task sequence.

ArgumentNullException Thrown when the input task sequence of task sequences is null.

TaskSeq.concat sources

Full Usage: TaskSeq.concat sources

Parameters:
    sources : TaskSeq<'a> - The input task-sequence-of-task-sequences.

Returns: TaskSeq<'T> The resulting, flattened 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.

sources : TaskSeq<'a>

The input task-sequence-of-task-sequences.

Returns: TaskSeq<'T>

The resulting, flattened task sequence.

ArgumentNullException Thrown when the input task sequence of task sequences is null.

TaskSeq.contains value source

Full Usage: TaskSeq.contains value source

Parameters:
    value : 'T - The value to locate in the input sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<bool> true if the input sequence contains the specified element; false otherwise.

Tests if the sequence contains the specified element. Returns true if source contains the specified element; false otherwise. The input task sequence is only evaluated until the first element that matches the value.

value : 'T

The value to locate in the input sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<bool>

true if the input sequence contains the specified element; false otherwise.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.countBy projection source

Full Usage: TaskSeq.countBy projection source

Parameters:
    projection : 'T -> 'Key - A function that transforms each element into a key.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<('Key * int)[]> A task returning an array of (key, count) pairs.

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.

projection : 'T -> 'Key

A function that transforms each element into a key.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<('Key * int)[]>

A task returning an array of (key, count) pairs.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.countByAsync projection source

Full Usage: TaskSeq.countByAsync projection source

Parameters:
    projection : 'T -> 'a - An asynchronous function that transforms each element into a key.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<('Key * int)[]> A task returning an array of (key, count) pairs.

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.

projection : 'T -> 'a

An asynchronous function that transforms each element into a key.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<('Key * int)[]>

A task returning an array of (key, count) pairs.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.delay generator

Full Usage: TaskSeq.delay generator

Parameters:
    generator : unit -> TaskSeq<'T> - The generating function for the task sequence.

Returns: TaskSeq<'T> The generated task sequence.

Returns a task sequence that is given by the delayed specification of a task sequence.

generator : unit -> TaskSeq<'T>

The generating function for the task sequence.

Returns: TaskSeq<'T>

The generated task sequence.

TaskSeq.distinct source

Full Usage: TaskSeq.distinct source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> A sequence with duplicate elements removed.

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.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

A sequence with duplicate elements removed.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.distinctBy projection source

Full Usage: TaskSeq.distinctBy projection source

Parameters:
    projection : '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.

projection : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.distinctByAsync projection source

Full Usage: TaskSeq.distinctByAsync projection source

Parameters:
    projection : '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.

projection : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.distinctUntilChanged source

Full Usage: TaskSeq.distinctUntilChanged source

Parameters:
    source : TaskSeq<'T> - The input task sequence whose consecutive duplicates will be removed.

Returns: TaskSeq<'T> A sequence without consecutive duplicates elements.

Returns a new task sequence without consecutive duplicate elements.

source : TaskSeq<'T>

The input task sequence whose consecutive duplicates will be removed.

Returns: TaskSeq<'T>

A sequence without consecutive duplicates elements.

ArgumentNullException Thrown when the input task sequences is null.

TaskSeq.drop count source

Full Usage: TaskSeq.drop count source

Parameters:
    count : int - The maximum number of items to drop.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

Returns a task sequence that, when iterated, drops at most count elements of the underlying sequence, and then returns the remainder of the elements, if any. See skip for a version that raises an exception if there are not enough elements. See also truncate for the inverse of this operation.

count : int

The maximum number of items to drop.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when count is less than zero.

TaskSeq.exactlyOne source

Full Usage: TaskSeq.exactlyOne source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The only element of the singleton task sequence, or None.

Returns the only element of the task sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The only element of the singleton task sequence, or None.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the input task sequence does not contain precisely one element.

TaskSeq.except itemsToExclude source

Full Usage: TaskSeq.except itemsToExclude source

Parameters:
    itemsToExclude : 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.

itemsToExclude : 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.

ArgumentNullException Thrown when either of the two input task sequences is null.

TaskSeq.exceptOfSeq itemsToExclude source

Full Usage: TaskSeq.exceptOfSeq itemsToExclude source

Parameters:
    itemsToExclude : '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.

itemsToExclude : '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.

ArgumentNullException Thrown when either of the two input task sequences is null.

TaskSeq.exists predicate source

Full Usage: TaskSeq.exists predicate source

Parameters:
    predicate : 'T -> bool - A function to test each item of the input sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<bool> true if any result from the predicate is true; false otherwise.

Tests if any element of the task sequence in source satisfies the given 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.

predicate : 'T -> bool

A function to test each item of the input sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<bool>

true if any result from the predicate is true; false otherwise.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.existsAsync predicate source

Full Usage: TaskSeq.existsAsync predicate source

Parameters:
    predicate : 'T -> 'a - A function to test each item of the input sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<bool> true if any result from the predicate is true; false otherwise.

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.

predicate : 'T -> 'a

A function to test each item of the input sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<bool>

true if any result from the predicate is true; false otherwise.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.filter predicate source

Full Usage: TaskSeq.filter predicate source

Parameters:
    predicate : 'T -> bool - A function to test whether an item in the input sequence should be included in the output or not.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> bool

A function to test whether an item in the input sequence should be included in the output or not.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.filterAsync predicate source

Full Usage: TaskSeq.filterAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function to test whether an item in the input sequence should be included in the output or not.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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 filter.

predicate : 'T -> 'a

An asynchronous function to test whether an item in the input sequence should be included in the output or not.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.find predicate source

Full Usage: TaskSeq.find predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The first element for which the predicate returns true.

Returns the first element for which the given function predicate returns true. Throws an exception if none is found. If predicate is asynchronous, consider using findAsync.

predicate : 'T -> bool

A function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The first element for which the predicate returns true.

ArgumentNullException Thrown when the input task sequence is null.
KeyNotFoundException Thrown if no element returns true when evaluated by the predicate function.

TaskSeq.findAsync predicate source

Full Usage: TaskSeq.findAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The first element for which the predicate returns true.

Returns the first element for which the given asynchronous function predicate returns true. Throws an exception if none is found. If predicate is synchronous, consider using find.

predicate : 'T -> 'a

An asynchronous function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The first element for which the predicate returns true.

ArgumentNullException Thrown when the input task sequence is null.
KeyNotFoundException Thrown if no element returns true when evaluated by the predicate function.

TaskSeq.findIndex predicate source

Full Usage: TaskSeq.findIndex predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int> The index for which the predicate returns true.

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.

predicate : 'T -> bool

A function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int>

The index for which the predicate returns true.

ArgumentNullException Thrown when the input task sequence is null.
KeyNotFoundException Thrown if no element returns true when evaluated by the predicate function.

TaskSeq.findIndexAsync predicate source

Full Usage: TaskSeq.findIndexAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int> The index for which the predicate returns true.

Returns the index, starting from zero, of the first element for which the given function predicate returns true. If predicate is synchronous, consider using findIndex.

predicate : 'T -> 'a

An asynchronous function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int>

The index for which the predicate returns true.

ArgumentNullException Thrown when the input task sequence is null.
KeyNotFoundException Thrown if no element returns true when evaluated by the predicate function.

TaskSeq.fold folder state source

Full Usage: TaskSeq.fold folder state source

Parameters:
    folder : 'State -> 'T -> 'State
    state : 'State
    source : TaskSeq<'T>

Returns: Task<'State>

then computes. If the accumulator function is asynchronous, consider using . argument of type through the computation. If the input function is and the elements are then computes . If the accumulator function is asynchronous, consider using .

A function that updates the state with each element from the sequence. The initial state. The input sequence. The state object after the folding function is applied to each element of the sequence. Thrown when the input task sequence is null.

folder : 'State -> 'T -> 'State
state : 'State
source : TaskSeq<'T>
Returns: Task<'State>

TaskSeq.foldAsync folder state source

Full Usage: TaskSeq.foldAsync folder state source

Parameters:
    folder : '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.

folder : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.forall predicate source

Full Usage: TaskSeq.forall predicate source

Parameters:
    predicate : '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.

predicate : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.forallAsync predicate source

Full Usage: TaskSeq.forallAsync predicate source

Parameters:
    predicate : '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.

Tests if all elements of the sequence satisfy the given asynchronous predicate. Stops evaluating as soon as predicate returns false. If predicate is synchronous, consider using forall.

predicate : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.groupBy projection source

Full Usage: TaskSeq.groupBy projection source

Parameters:
    projection : 'T -> 'Key - A function that transforms each element into a key.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<('Key * 'T[])[]> A task returning an array of (key, elements[]) pairs.

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.

projection : 'T -> 'Key

A function that transforms each element into a key.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<('Key * 'T[])[]>

A task returning an array of (key, elements[]) pairs.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.groupByAsync projection source

Full Usage: TaskSeq.groupByAsync projection source

Parameters:
    projection : 'T -> 'a - An asynchronous function that transforms each element into a key.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<('Key * 'T[])[]> A task returning an array of (key, elements[]) pairs.

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.

projection : 'T -> 'a

An asynchronous function that transforms each element into a key.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<('Key * 'T[])[]>

A task returning an array of (key, elements[]) pairs.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.head source

Full Usage: TaskSeq.head source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The first element of the task sequence.

Returns the first element of the input task sequence given by source.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The first element of the task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the task sequence is empty.

TaskSeq.indexed source

Full Usage: TaskSeq.indexed source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<int * 'T> The resulting task sequence of tuples.

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.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<int * 'T>

The resulting task sequence of tuples.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.init count initializer

Full Usage: TaskSeq.init count initializer

Parameters:
    count : 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.

count : 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.

ArgumentException Thrown when count is negative.

TaskSeq.initAsync count initializer

Full Usage: TaskSeq.initAsync count initializer

Parameters:
    count : 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.

count : 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.

ArgumentException Thrown when count is negative.

TaskSeq.initInfinite initializer

Full Usage: TaskSeq.initInfinite initializer

Parameters:
    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, 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.

initializer : int -> 'T

A function that generates an item in the sequence from a given index.

Returns: TaskSeq<'T>

The resulting task sequence.

TaskSeq.initInfiniteAsync initializer

Full Usage: TaskSeq.initInfiniteAsync initializer

Parameters:
    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, 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.

initializer : int -> 'a

A function that generates an item in the sequence from a given index.

Returns: TaskSeq<'T>

The resulting task sequence.

TaskSeq.insertAt index value source

Full Usage: TaskSeq.insertAt index value source

Parameters:
    index : int - The index where the item should be inserted.
    value : 'T - The value to insert.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The result task sequence.

Return a new task sequence with a new item inserted before the given index.

index : int

The index where the item should be inserted.

value : 'T

The value to insert.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The result task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when index is below 0 or greater than source length.

TaskSeq.insertManyAt index values source

Full Usage: TaskSeq.insertManyAt index values source

Parameters:
    index : int - The index where the items should be inserted.
    values : TaskSeq<'T>
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The result task sequence.

Return a new task sequence with the new items inserted before the given index.

index : int

The index where the items should be inserted.

values : TaskSeq<'T>
source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The result task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when index is below 0 or greater than source length.

TaskSeq.isEmpty source

Full Usage: TaskSeq.isEmpty source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<bool>

Returns true if the task sequence contains no elements, false otherwise.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<bool>
ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.item index source

Full Usage: TaskSeq.item index source

Parameters:
    index : int - The index of the item to retrieve.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The nth element of the task sequence.

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.

index : int

The index of the item to retrieve.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The nth element of the task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the sequence has insufficient length or index is negative.

TaskSeq.iter action source

Full Usage: TaskSeq.iter action source

Parameters:
    action : 'T -> unit - A function to apply to each element of the task sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<unit> A unittask.

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.

action : 'T -> unit

A function to apply to each element of the task sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<unit>

A unittask.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.iterAsync action source

Full Usage: TaskSeq.iterAsync action source

Parameters:
    action : 'T -> 'a - An asynchronous function to apply to each element of the task sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<unit> A unittask.

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.

action : 'T -> 'a

An asynchronous function to apply to each element of the task sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<unit>

A unittask.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.iteri action source

Full Usage: TaskSeq.iteri action source

Parameters:
    action : int -> 'T -> unit - A function to apply to each element of the task sequence that can also access the current index.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<unit> A unittask.

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.

action : int -> 'T -> unit

A function to apply to each element of the task sequence that can also access the current index.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<unit>

A unittask.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.iteriAsync action source

Full Usage: TaskSeq.iteriAsync action source

Parameters:
    action : int -> 'T -> 'a - An asynchronous function to apply to each element of the task sequence that can also access the current index.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<unit> A unittask.

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.

action : int -> 'T -> 'a

An asynchronous function to apply to each element of the task sequence that can also access the current index.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<unit>

A unittask.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.last source

Full Usage: TaskSeq.last source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The last element of the task sequence.

Returns the last element of the input task sequence given by source.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The last element of the task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the task sequence is empty.

TaskSeq.length source

Full Usage: TaskSeq.length source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int>

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.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int>
ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.lengthBy predicate source

Full Usage: TaskSeq.lengthBy predicate source

Parameters:
    predicate : 'T -> bool - A function to test whether an item in the input sequence should be included in the count.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int>

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.

predicate : 'T -> bool

A function to test whether an item in the input sequence should be included in the count.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int>
ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.lengthByAsync predicate source

Full Usage: TaskSeq.lengthByAsync predicate source

Parameters:
    predicate : 'T -> 'a - A function to test whether an item in the input sequence should be included in the count.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int>

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.

predicate : 'T -> 'a

A function to test whether an item in the input sequence should be included in the count.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int>
ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.lengthOrMax max source

Full Usage: TaskSeq.lengthOrMax max source

Parameters:
    max : int - Limit at which to stop evaluating source items for finding the length.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int>

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.

max : int

Limit at which to stop evaluating source items for finding the length.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int>
ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.map mapper source

Full Usage: TaskSeq.map mapper source

Parameters:
    mapper : 'T -> 'U - A function to transform items from the input task sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

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.

mapper : 'T -> 'U

A function to transform items from the input task sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.mapAsync mapper source

Full Usage: TaskSeq.mapAsync mapper source

Parameters:
    mapper : 'T -> 'a - An asynchronous function to transform items from the input task sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

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.

mapper : 'T -> 'a

An asynchronous function to transform items from the input task sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.mapFold mapping state source

Full Usage: TaskSeq.mapFold mapping state source

Parameters:
    mapping : '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.

mapping : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.mapFoldAsync mapping state source

Full Usage: TaskSeq.mapFoldAsync mapping state source

Parameters:
    mapping : '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.

mapping : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.mapi mapper source

Full Usage: TaskSeq.mapi mapper source

Parameters:
    mapper : int -> 'T -> 'U - A function to transform items from the input task sequence that also access the current index.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

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.

mapper : int -> 'T -> 'U

A function to transform items from the input task sequence that also access the current index.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.mapiAsync mapper source

Full Usage: TaskSeq.mapiAsync mapper source

Parameters:
    mapper : int -> 'T -> 'a - An asynchronous function to transform items from the input task sequence that also access the current index.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

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.

mapper : int -> 'T -> 'a

An asynchronous function to transform items from the input task sequence that also access the current index.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.max source

Full Usage: TaskSeq.max source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The largest element of the sequence.

Returns the greatest of all elements of the sequence, compared via max.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The largest element of the sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the input task sequence is empty.

TaskSeq.maxBy projection source

Full Usage: TaskSeq.maxBy projection source

Parameters:
    projection : 'T -> 'U - A function to transform items from the input sequence into comparable keys.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'T> The largest element of the sequence.

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.

projection : 'T -> 'U

A function to transform items from the input sequence into comparable keys.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'T>

The largest element of the sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input sequence is empty.

TaskSeq.maxByAsync projection source

Full Usage: TaskSeq.maxByAsync projection source

Parameters:
    projection : 'T -> 'a - A function to transform items from the input sequence into comparable keys.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'T> The largest element of the sequence.

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 synchronous, consider using maxBy.

projection : 'T -> 'a

A function to transform items from the input sequence into comparable keys.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'T>

The largest element of the sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input sequence is empty.

TaskSeq.min source

Full Usage: TaskSeq.min source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T> The smallest element of the sequence.

Returns the smallest of all elements of the sequence, compared via min.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T>

The smallest element of the sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the input task sequence is empty.

TaskSeq.minBy projection source

Full Usage: TaskSeq.minBy projection source

Parameters:
    projection : 'T -> 'U - A function to transform items from the input sequence into comparable keys.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'T> The smallest element of the sequence.

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.

projection : 'T -> 'U

A function to transform items from the input sequence into comparable keys.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'T>

The smallest element of the sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input sequence is empty.

TaskSeq.minByAsync projection source

Full Usage: TaskSeq.minByAsync projection source

Parameters:
    projection : 'T -> 'a - A function to transform items from the input sequence into comparable keys.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'T> The smallest element of the sequence.

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 synchronous, consider using minBy.

projection : 'T -> 'a

A function to transform items from the input sequence into comparable keys.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'T>

The smallest element of the sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input sequence is empty.

TaskSeq.ofArray source

Full Usage: TaskSeq.ofArray source

Parameters:
    source : '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>.

source : 'T[]

The input array.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input array is null.

TaskSeq.ofAsyncArray source

Full Usage: TaskSeq.ofAsyncArray source

Parameters:
    source : Async<'T> array - The input array-of-asyncs.

Returns: TaskSeq<'T> The resulting task sequence.

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.

source : Async<'T> array

The input array-of-asyncs.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.ofAsyncList source

Full Usage: TaskSeq.ofAsyncList source

Parameters:
    source : Async<'T> list - The input list-of-asyncs.

Returns: TaskSeq<'T> The resulting task sequence.

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.

source : Async<'T> list

The input list-of-asyncs.

Returns: TaskSeq<'T>

The resulting task sequence.

TaskSeq.ofAsyncSeq source

Full Usage: TaskSeq.ofAsyncSeq source

Parameters:
    source : Async<'T> seq - The input sequence-of-asyncs.

Returns: TaskSeq<'T> The resulting task sequence.

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.

source : Async<'T> seq

The input sequence-of-asyncs.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.ofList source

Full Usage: TaskSeq.ofList source

Parameters:
    source : '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>.

source : 'T list

The input list.

Returns: TaskSeq<'T>

The resulting task sequence.

TaskSeq.ofResizeArray source

Full Usage: TaskSeq.ofResizeArray source

Parameters:
    source : 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>.

source : ResizeArray<'T>

The input resize array.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input resize array is null.

TaskSeq.ofSeq source

Full Usage: TaskSeq.ofSeq source

Parameters:
    source : '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>.

source : 'T seq

The input sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.ofTaskArray source

Full Usage: TaskSeq.ofTaskArray source

Parameters:
    source : '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.

source : 'a array

The input array-of-tasks.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input array is null.

TaskSeq.ofTaskList source

Full Usage: TaskSeq.ofTaskList source

Parameters:
    source : '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.

source : 'a list

The input list-of-tasks.

Returns: TaskSeq<'T>

The resulting task sequence.

TaskSeq.ofTaskSeq source

Full Usage: TaskSeq.ofTaskSeq source

Parameters:
    source : '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.

source : 'a seq

The input sequence-of-tasks.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.pairwise source

Full Usage: TaskSeq.pairwise source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T * 'T> A task sequence of consecutive element pairs.

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.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T * 'T>

A task sequence of consecutive element pairs.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.partition predicate source

Full Usage: TaskSeq.partition predicate source

Parameters:
    predicate : 'T -> bool - A 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: those for which the given predicate returns true, and those for which it returns false. The relative order of elements within each partition is preserved.

This function consumes the entire source task sequence before returning. If the predicate function predicate is asynchronous, consider using partitionAsync.

predicate : 'T -> bool

A 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).

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.partitionAsync predicate source

Full Usage: TaskSeq.partitionAsync predicate source

Parameters:
    predicate : '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 true, and those for which it returns false. The relative order of elements within each partition is preserved.

This function consumes the entire source task sequence before returning. If the predicate function predicate is synchronous, consider using partition.

predicate : '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).

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.pick chooser source

Full Usage: TaskSeq.pick chooser source

Parameters:
    chooser : 'T -> 'U option - A function to transform items of type 'T into options of type 'U.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'U> The selected element.

Applies the given function chooser to successive elements, returning the first result where the function returns Some(x). Throws an exception if none is found. If chooser is asynchronous, consider using pickAsync.

chooser : 'T -> 'U option

A function to transform items of type 'T into options of type 'U.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'U>

The selected element.

ArgumentNullException Thrown when the input task sequence is null.
KeyNotFoundException Thrown when every item of the sequence evaluates to None when the given function is applied.

TaskSeq.pickAsync chooser source

Full Usage: TaskSeq.pickAsync chooser source

Parameters:
    chooser : 'T -> 'a - An asynchronous function to transform items of type 'T into options of type 'U.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'U> The selected element.

Applies the given asynchronous function chooser to successive elements, returning the first result where the function returns Some(x). Throws an exception if none is found. If chooser is synchronous, consider using pick.

chooser : 'T -> 'a

An asynchronous function to transform items of type 'T into options of type 'U.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'U>

The selected element.

ArgumentNullException Thrown when the input task sequence is null.
KeyNotFoundException Thrown when every item of the sequence evaluates to None when the given function is applied.

TaskSeq.prependSeq source1 source2

Full Usage: TaskSeq.prependSeq source1 source2

Parameters:
    source1 : 'T seq - The input F# seq sequence.
    source2 : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

Concatenates a (non-async) F# seq in source1 with a task sequence in source2 and returns a single task sequence.

source1 : 'T seq

The input F# seq sequence.

source2 : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when either of the input sequences is null.

TaskSeq.reduce folder source

Full Usage: TaskSeq.reduce folder source

Parameters:
    folder : 'T -> 'T -> 'T - A function that updates the state with each element from the sequence.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'T> The final state value after applying the reduction function to all elements.

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.

folder : 'T -> 'T -> 'T

A function that updates the state with each element from the sequence.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'T>

The final state value after applying the reduction function to all elements.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the input task sequence is empty.

TaskSeq.reduceAsync folder source

Full Usage: TaskSeq.reduceAsync folder source

Parameters:
    folder : 'T -> 'T -> 'a - A function that updates the state with each element from the sequence.
    source : TaskSeq<'T> - The input sequence.

Returns: Task<'T> The final state value after applying the reduction function to all elements.

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.

folder : 'T -> 'T -> 'a

A function that updates the state with each element from the sequence.

source : TaskSeq<'T>

The input sequence.

Returns: Task<'T>

The final state value after applying the reduction function to all elements.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the input task sequence is empty.

TaskSeq.removeAt index source

Full Usage: TaskSeq.removeAt index source

Parameters:
    index : int - The index where the item should be removed.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The result task sequence.

Return a new task sequence with the item at the given index removed.

index : int

The index where the item should be removed.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The result task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when index is below 0 or greater than source length.

TaskSeq.removeManyAt index count source

Full Usage: TaskSeq.removeManyAt index count source

Parameters:
    index : int - The index where the items should be removed.
    count : int - The number of items to remove.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The result task sequence.

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.

index : int

The index where the items should be removed.

count : int

The number of items to remove.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The result task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when index is below 0 or greater than source length.

TaskSeq.replicate count value

Full Usage: TaskSeq.replicate count value

Parameters:
    count : 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.

count : 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.

ArgumentException Thrown when count is negative.

TaskSeq.scan folder state source

Full Usage: TaskSeq.scan folder state source

Parameters:
    folder : '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 N elements, the output task sequence has N + 1 elements. If the folder function folder is asynchronous, consider using scanAsync.

folder : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.scanAsync folder state source

Full Usage: TaskSeq.scanAsync folder state source

Parameters:
    folder : '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 N elements, the output task sequence has N + 1 elements. If the folder function folder is synchronous, consider using scan.

folder : '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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.singleton value

Full Usage: TaskSeq.singleton value

Parameters:
    value : '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.

value : 'T

The input item to use as the single item of the task sequence.

Returns: TaskSeq<'T>

TaskSeq.skip count source

Full Usage: TaskSeq.skip count source

Parameters:
    count : int - The number of items to skip.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

Returns a task sequence that, when iterated, skips count elements of the underlying sequence, and then yields the remainder. Raises an exception if there are not count items. See drop for a version that does not raise an exception. See also take for the inverse of this operation.

count : int

The number of items to skip.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when count is less than zero or when it exceeds the number of elements in the sequence.

TaskSeq.skipWhile predicate source

Full Usage: TaskSeq.skipWhile predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to false when no more items should be skipped.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> bool

A function that evaluates to false when no more items should be skipped.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.skipWhileAsync predicate source

Full Usage: TaskSeq.skipWhileAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to false when no more items should be skipped.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> 'a

An asynchronous function that evaluates to false when no more items should be skipped.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.skipWhileInclusive predicate source

Full Usage: TaskSeq.skipWhileInclusive predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to false for the final item to be skipped.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> bool

A function that evaluates to false for the final item to be skipped.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.skipWhileInclusiveAsync predicate source

Full Usage: TaskSeq.skipWhileInclusiveAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to false for the final item to be skipped.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> 'a

An asynchronous function that evaluates to false for the final item to be skipped.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tail source

Full Usage: TaskSeq.tail source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<TaskSeq<'T>> The input task sequence minus the first element.

Returns the whole task sequence from source, minus its first element.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<TaskSeq<'T>>

The input task sequence minus the first element.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when the task sequence is empty.

TaskSeq.take count source

Full Usage: TaskSeq.take count source

Parameters:
    count : int - The number of items to take.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

count : int

The number of items to take.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when count is less than zero or when it exceeds the number of elements in the sequence.

TaskSeq.takeWhile predicate source

Full Usage: TaskSeq.takeWhile predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to false when no more items should be returned.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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 false. (see also takeWhileInclusive). If predicate is asynchronous, consider using takeWhileAsync.

predicate : 'T -> bool

A function that evaluates to false when no more items should be returned.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.takeWhileAsync predicate source

Full Usage: TaskSeq.takeWhileAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to false when no more items should be returned.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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 false. (see also takeWhileInclusiveAsync). If predicate is synchronous, consider using takeWhile.

predicate : 'T -> 'a

An asynchronous function that evaluates to false when no more items should be returned.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.takeWhileInclusive predicate source

Full Usage: TaskSeq.takeWhileInclusive predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to false when no more items should be returned.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> bool

A function that evaluates to false when no more items should be returned.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.takeWhileInclusiveAsync predicate source

Full Usage: TaskSeq.takeWhileInclusiveAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to false when no more items should be returned.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> 'a

An asynchronous function that evaluates to false when no more items should be returned.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.toArray source

Full Usage: TaskSeq.toArray source

Parameters:
    source : 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.

source : TaskSeq<'T>

The input task sequence.

Returns: 'T[]

The resulting array.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.toArrayAsync source

Full Usage: TaskSeq.toArrayAsync source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T[]> The resulting array.

Builds an array asynchronously from the input task sequence. This function is non-blocking while it builds the array.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T[]>

The resulting array.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.toIListAsync source

Full Usage: TaskSeq.toIListAsync source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<IList<'T>> The resulting IList interface.

Builds an IList<'T> asynchronously from the input task sequence. This function is non-blocking while it builds the IList.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<IList<'T>>

The resulting IList interface.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.toList source

Full Usage: TaskSeq.toList source

Parameters:
    source : 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.

source : TaskSeq<'T>

The input task sequence.

Returns: 'T list

The resulting list.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.toListAsync source

Full Usage: TaskSeq.toListAsync source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T list> The resulting list.

Builds an F# list asynchronously from the input task sequence. This function is non-blocking while it builds the list.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T list>

The resulting list.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.toResizeArrayAsync source

Full Usage: TaskSeq.toResizeArrayAsync source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<ResizeArray<'T>> The resulting resizable array.

Gathers items into a ResizeArray (see List<_>) asynchronously from the input task sequence. This function is non-blocking while it builds the resizable array.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<ResizeArray<'T>>

The resulting resizable array.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.toSeq source

Full Usage: TaskSeq.toSeq source

Parameters:
    source : 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.

source : TaskSeq<'T>

The input task sequence.

Returns: 'T seq

The resulting task sequence.

ArgumentNullException Thrown when the input sequence is null.

TaskSeq.truncate count source

Full Usage: TaskSeq.truncate count source

Parameters:
    count : int - The maximum number of items to enumerate.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

Returns a task sequence that, when iterated, yields at most count elements of the underlying sequence, truncating the remainder, if any. See take for a version that raises an exception if there are not enough elements in the sequence. See also drop for the inverse of this operation.

count : int

The maximum number of items to enumerate.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when count is less than zero.

TaskSeq.tryExactlyOne source

Full Usage: TaskSeq.tryExactlyOne source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T option> The only element of the singleton task sequence, or None.

Returns the only element of the task sequence, or None if the sequence is empty of contains more than one element.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T option>

The only element of the singleton task sequence, or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryFind predicate source

Full Usage: TaskSeq.tryFind predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T option> The found element or None.

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.

predicate : 'T -> bool

A function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T option>

The found element or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryFindAsync predicate source

Full Usage: TaskSeq.tryFindAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T option> The found element or None.

Returns the first element for which the given asynchronous function predicate returns true. Returns None if no such element exists. If predicate is synchronous, consider using tryFind.

predicate : 'T -> 'a

An asynchronous function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T option>

The found element or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryFindIndex predicate source

Full Usage: TaskSeq.tryFindIndex predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int option> The found element or None.

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.

predicate : 'T -> bool

A function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int option>

The found element or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryFindIndexAsync predicate source

Full Usage: TaskSeq.tryFindIndexAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function that evaluates to a bool when given an item in the sequence.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<int option> The found element or None.

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.

predicate : 'T -> 'a

An asynchronous function that evaluates to a bool when given an item in the sequence.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<int option>

The found element or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryHead source

Full Usage: TaskSeq.tryHead source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T option> The first element of the task sequence, or None.

Returns the first element of the input task sequence given by source, or None if the sequence is empty.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T option>

The first element of the task sequence, or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryItem index source

Full Usage: TaskSeq.tryItem index source

Parameters:
    index : int - The index of the item to retrieve.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T option> The nth element of the task sequence, or None if it doesn't exist.

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.

index : int

The index of the item to retrieve.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T option>

The nth element of the task sequence, or None if it doesn't exist.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryLast source

Full Usage: TaskSeq.tryLast source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'T option> The last element of the task sequence, or None.

Returns the last element of the input task sequence given by source, or None if the sequence is empty.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'T option>

The last element of the task sequence, or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryPick chooser source

Full Usage: TaskSeq.tryPick chooser source

Parameters:
    chooser : 'T -> 'U option - A function to transform items of type 'T into options of type 'U.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'U option> The chosen element or None.

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.

chooser : 'T -> 'U option

A function to transform items of type 'T into options of type 'U.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'U option>

The chosen element or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryPickAsync chooser source

Full Usage: TaskSeq.tryPickAsync chooser source

Parameters:
    chooser : 'T -> 'a - An asynchronous function to transform items of type 'T into options of type 'U.
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<'U option> The chosen element or None.

Applies the given asynchronous function chooser to successive elements, returning the first result where the function returns Some(x). If chooser is synchronous, consider using tryPick.

chooser : 'T -> 'a

An asynchronous function to transform items of type 'T into options of type 'U.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<'U option>

The chosen element or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.tryTail source

Full Usage: TaskSeq.tryTail source

Parameters:
    source : TaskSeq<'T> - The input task sequence.

Returns: Task<TaskSeq<'T> option> The input task sequence minus the first element, or None.

Returns the whole input task sequence given by source, minus its first element, or None if the sequence is empty.

source : TaskSeq<'T>

The input task sequence.

Returns: Task<TaskSeq<'T> option>

The input task sequence minus the first element, or None.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.unbox source

Full Usage: TaskSeq.unbox source

Parameters:
    source : TaskSeq<obj> - The input task sequence.

Returns: TaskSeq<'U> The resulting task sequence.

Calls unbox on each item when the task sequence is consumed. The target type must be a value type.

source : TaskSeq<obj>

The input task sequence.

Returns: TaskSeq<'U>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.
InvalidCastException Thrown when the function is unable to cast an item to the target type.

TaskSeq.unfold generator state

Full Usage: TaskSeq.unfold generator state

Parameters:
    generator : '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 None. Each call to generator returns either None, which terminates the sequence, or Some(element, newState), which yields element and updates the state for the next call. Unlike init, the number of elements need not be known in advance. If the generator function is asynchronous, consider using unfoldAsync.

generator : '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.

TaskSeq.unfoldAsync generator state

Full Usage: TaskSeq.unfoldAsync generator state

Parameters:
    generator : '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 None. Each call to generator returns either None, which terminates the sequence, or Some(element, newState), which yields element and updates the state. Unlike initAsync, the number of elements need not be known in advance. If the generator function is synchronous, consider using unfold.

generator : '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.

TaskSeq.updateAt index value source

Full Usage: TaskSeq.updateAt index value source

Parameters:
    index : int - The index of the item to be replaced.
    value : 'T - The new value.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The result task sequence.

Return a new task sequence with the item at a given index set to the new value.

index : int

The index of the item to be replaced.

value : 'T

The new value.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The result task sequence.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when index is below 0 or greater than source length.

TaskSeq.where predicate source

Full Usage: TaskSeq.where predicate source

Parameters:
    predicate : 'T -> bool - A function to test whether an item in the input sequence should be included in the output or not.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> bool

A function to test whether an item in the input sequence should be included in the output or not.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.whereAsync predicate source

Full Usage: TaskSeq.whereAsync predicate source

Parameters:
    predicate : 'T -> 'a - An asynchronous function to test whether an item in the input sequence should be included in the output or not.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T> The resulting task sequence.

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.

predicate : 'T -> 'a

An asynchronous function to test whether an item in the input sequence should be included in the output or not.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T>

The resulting task sequence.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.windowed windowSize source

Full Usage: TaskSeq.windowed windowSize source

Parameters:
    windowSize : int - The number of elements in each window. Must be positive.
    source : TaskSeq<'T> - The input task sequence.

Returns: TaskSeq<'T[]> A task sequence of overlapping array windows.

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).

windowSize : int

The number of elements in each window. Must be positive.

source : TaskSeq<'T>

The input task sequence.

Returns: TaskSeq<'T[]>

A task sequence of overlapping array windows.

ArgumentNullException Thrown when the input task sequence is null.
ArgumentException Thrown when windowSize is not positive.

TaskSeq.withCancellation cancellationToken source

Full Usage: TaskSeq.withCancellation cancellationToken source

Parameters:
    cancellationToken : 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 .WithCancellation(cancellationToken) on an IAsyncEnumerable<'T>.

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 GetAsyncEnumerator.

cancellationToken : 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.

ArgumentNullException Thrown when the input task sequence is null.

TaskSeq.zip source1 source2

Full Usage: TaskSeq.zip source1 source2

Parameters:
    source1 : TaskSeq<'T> - The first input task sequence.
    source2 : TaskSeq<'U> - The second input task sequence.

Returns: TaskSeq<'T * 'U> The result task sequence of tuples.

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.

source1 : TaskSeq<'T>

The first input task sequence.

source2 : TaskSeq<'U>

The second input task sequence.

Returns: TaskSeq<'T * 'U>

The result task sequence of tuples.

ArgumentNullException Thrown when either of the two input task sequences is null.

TaskSeq.zip3 source1 source2 source3

Full Usage: TaskSeq.zip3 source1 source2 source3

Parameters:
    source1 : 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.

source1 : 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.

ArgumentNullException Thrown when any of the three input task sequences is null.

Type something to start searching.