Logo ResizeArray

Parallel Module

Parallel operations on ResizeArray using Threading.Tasks.Parallel.For The API is aligned with from FSharp.Core.Array.Parallel module

Functions and values

Function or value Description

average resizeArray

Full Usage: average resizeArray

Parameters:
    resizeArray : ResizeArray<^T> - The input ResizeArray.

Returns: ^T The average of the elements in the ResizeArray.
Modifiers: inline
Type parameters: ^T (requires (static member op_Addition : ^T * ^T -> ^T) and (static member DivideByInt : ^T * Microsoft.FSharp.Core.int -> ^T))

Returns the average of the elements in the ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.average, because the elements are added in a different order.

resizeArray : ResizeArray<^T>

The input ResizeArray.

Returns: ^T

The average of the elements in the ResizeArray.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

averageBy projection resizeArray

Full Usage: averageBy projection resizeArray

Parameters:
    projection : 'T -> ^Key - The function to transform the ResizeArray elements before averaging.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ^Key The computed average.
Modifiers: inline
Type parameters: 'T, ^Key (requires (static member op_Addition : ^Key * ^Key -> ^Key) and (static member DivideByInt : ^Key * Microsoft.FSharp.Core.int -> ^Key))

Returns the average of the elements generated by applying the function to each element of the ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.averageBy, because the elements are added in a different order.

projection : 'T -> ^Key

The function to transform the ResizeArray elements before averaging.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ^Key

The computed average.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

choose chooser resizeArray

Full Usage: choose chooser resizeArray

Parameters:
    chooser : 'T -> 'U option - The function to generate options from the elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'U> The ResizeArray of results.
Type parameters: 'T, 'U

Apply the given function to each element of the ResizeArray. Return the ResizeArray comprised of the results "x" for each element where the function returns Some(x). Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

chooser : 'T -> 'U option

The function to generate options from the elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'U>

The ResizeArray of results.

collect mapping resizeArray

Full Usage: collect mapping resizeArray

Parameters:
    mapping : 'T -> ResizeArray<'U> - The function to transform each input element into a ResizeArray.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'U> The combined ResizeArray of mapped elements.
Type parameters: 'T, 'U

For each element of the ResizeArray, apply the given function. Concatenate all the results and return the combined ResizeArray. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

mapping : 'T -> ResizeArray<'U>

The function to transform each input element into a ResizeArray.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'U>

The combined ResizeArray of mapped elements.

exists predicate resizeArray

Full Usage: exists predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: bool True if any result from predicate is true.
Type parameters: 'T

Tests if any element of the ResizeArray satisfies the given predicate. The predicate is applied to the elements of the input ResizeArray in parallel. If any application returns true then the overall result is true and testing of other elements in all threads is stopped at system's earliest convenience. Otherwise, false is returned.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: bool

True if any result from predicate is true.

filter predicate resizeArray

Full Usage: filter predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> A ResizeArray containing the elements for which the given predicate returns true.
Type parameters: 'T

Returns a new ResizeArray containing only the elements of the ResizeArray for which the given predicate returns true. The order of the elements is preserved. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T>

A ResizeArray containing the elements for which the given predicate returns true.

forall predicate resizeArray

Full Usage: forall predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: bool True if all of the ResizeArray elements satisfy the predicate.
Type parameters: 'T

Tests if all elements of the ResizeArray satisfy the given predicate. The predicate is applied to the elements of the input ResizeArray in parallel. If any application returns false then the overall result is false and testing of other elements in all threads is stopped at system's earliest convenience. Otherwise, true is returned.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: bool

True if all of the ResizeArray elements satisfy the predicate.

groupBy projection resizeArray

Full Usage: groupBy projection resizeArray

Parameters:
    projection : 'T -> 'Key - A function that transforms an element of the ResizeArray into a comparable key. Null or Option.None is allowed as key.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'Key * ResizeArray<'T>> The result ResizeArray.
Type parameters: 'T, 'Key (requires equality)

Applies a key-generating function to each element of a ResizeArray in parallel and yields a ResizeArray of unique keys. Each unique key contains a ResizeArray of all elements that match to this key. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified. Unlike with ResizeArray.groupBy, the order of the keys and of the elements within each group is not specified either. Like in Array.Parallel.groupBy, all float and float32 nan keys are put in one group.

projection : 'T -> 'Key

A function that transforms an element of the ResizeArray into a comparable key. Null or Option.None is allowed as key.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'Key * ResizeArray<'T>>

The result ResizeArray.

init count initializer

Full Usage: init count initializer

Parameters:
    count : int - The number of elements to create.
    initializer : int -> 'T - The function used to initialize each element from its index.

Returns: ResizeArray<'T> The ResizeArray of results.
Type parameters: 'T

Create a ResizeArray given the dimension and a generator function to compute the elements. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.

count : int

The number of elements to create.

initializer : int -> 'T

The function used to initialize each element from its index.

Returns: ResizeArray<'T>

The ResizeArray of results.

iter action resizeArray

Full Usage: iter action resizeArray

Parameters:
    action : 'T -> unit - The function to apply to each element.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Type parameters: 'T

Apply the given function to each element of the ResizeArray. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

action : 'T -> unit

The function to apply to each element.

resizeArray : ResizeArray<'T>

The input ResizeArray.

iteri action resizeArray

Full Usage: iteri action resizeArray

Parameters:
    action : int -> 'T -> unit - The function to apply to each index and element.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Type parameters: 'T

Apply the given function to each element of the ResizeArray. The integer passed to the function indicates the index of element. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

action : int -> 'T -> unit

The function to apply to each index and element.

resizeArray : ResizeArray<'T>

The input ResizeArray.

map mapping resizeArray

Full Usage: map mapping resizeArray

Parameters:
    mapping : 'T -> 'U - The function to transform each element.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'U> The ResizeArray of results.
Type parameters: 'T, 'U

Build a new ResizeArray whose elements are the results of applying the given function to each of the elements of the ResizeArray. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

mapping : 'T -> 'U

The function to transform each element.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'U>

The ResizeArray of results.

mapi mapping resizeArray

Full Usage: mapi mapping resizeArray

Parameters:
    mapping : int -> 'T -> 'U - The function to transform each index and element.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'U> The ResizeArray of results.
Type parameters: 'T, 'U

Build a new ResizeArray whose elements are the results of applying the given function to each of the elements of the ResizeArray. The integer index passed to the function indicates the index of element being transformed. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.

mapping : int -> 'T -> 'U

The function to transform each index and element.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'U>

The ResizeArray of results.

max resizeArray

Full Usage: max resizeArray

Parameters:
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T The maximum element, or NaN.
Modifiers: inline
Type parameters: 'T (requires comparison)

Returns the greatest of all elements of the ResizeArray. NaN propagates: if any element is NaN, NaN is returned, like ResizeArray.max. If several elements are the greatest, the first one of them is returned. Performs the operation in parallel using Parallel.For.

This is the 'maximum' operation of IEEE 754:2019: NaN propagates and +0.0 is bigger than -0.0. See https://github.com/dotnet/fsharp/issues/13207#issuecomment-1194411950

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T

The maximum element, or NaN.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

maxBy projection resizeArray

Full Usage: maxBy projection resizeArray

Parameters:
    projection : 'T -> 'Key - The function to transform the elements into a type supporting comparison.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T The maximum element.
Modifiers: inline
Type parameters: 'T, 'Key (requires comparison)

Returns the element of the ResizeArray with the greatest projected key. NaN keys are ignored like in ResizeArray.maxBy: elements with a NaN key are only returned if all keys are NaN. If several keys are the greatest, the first element of them is returned. Performs the operation in parallel using Parallel.For.

projection : 'T -> 'Key

The function to transform the elements into a type supporting comparison.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T

The maximum element.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

min resizeArray

Full Usage: min resizeArray

Parameters:
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T The minimum element, or NaN.
Modifiers: inline
Type parameters: 'T (requires comparison)

Returns the smallest of all elements of the ResizeArray. NaN propagates: if any element is NaN, NaN is returned, like ResizeArray.min. If several elements are the smallest, the first one of them is returned. Performs the operation in parallel using Parallel.For.

This is the 'minimum' operation of IEEE 754:2019: NaN propagates and -0.0 is smaller than +0.0. See https://github.com/dotnet/fsharp/issues/13207#issuecomment-1194411950

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T

The minimum element, or NaN.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

minBy projection resizeArray

Full Usage: minBy projection resizeArray

Parameters:
    projection : 'T -> 'Key - The function to transform the elements into a type supporting comparison.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T The minimum element.
Modifiers: inline
Type parameters: 'T, 'Key (requires comparison)

Returns the element of the ResizeArray with the smallest projected key. NaN keys are ignored like in ResizeArray.minBy: elements with a NaN key are only returned if all keys are NaN. If several keys are the smallest, the first element of them is returned. Performs the operation in parallel using Parallel.For.

projection : 'T -> 'Key

The function to transform the elements into a type supporting comparison.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T

The minimum element.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

partition predicate resizeArray

Full Usage: partition predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> * ResizeArray<'T> The two ResizeArrays of results.
Type parameters: 'T

Split the collection into two collections, containing the elements for which the given predicate returns true and false respectively. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T> * ResizeArray<'T>

The two ResizeArrays of results.

partitionWith partitioner resizeArray

Full Usage: partitionWith partitioner resizeArray

Parameters:
    partitioner : 'T -> Choice<'U1, 'U2> - The function to transform and classify each input element into one of two output types.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'U1> * ResizeArray<'U2> A tuple of two ResizeArrays. The first containing values from Choice1Of2 results and the second containing values from Choice2Of2 results.
Type parameters: 'T, 'U1, 'U2

Splits the collection into two ResizeArrays, by applying the given partitioning function to each element. Returns Choice1Of2 elements in the first ResizeArray and Choice2Of2 elements in the second ResizeArray. Element order is preserved in both of the created ResizeArrays. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified. The partitioner function must be thread-safe.

partitioner : 'T -> Choice<'U1, 'U2>

The function to transform and classify each input element into one of two output types.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'U1> * ResizeArray<'U2>

A tuple of two ResizeArrays. The first containing values from Choice1Of2 results and the second containing values from Choice2Of2 results.

reduce reduction resizeArray

Full Usage: reduce reduction resizeArray

Parameters:
    reduction : 'T -> 'T -> 'T - The function to reduce a pair of elements to a single element.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T The final result of the reductions.
Type parameters: 'T

Applies a function to each element of the ResizeArray in parallel, threading an accumulator argument through the computation for each thread involved in the computation. After processing the entire input, results from all threads are reduced together. Raises ArgumentException if the ResizeArray is empty. The ResizeArray is split into contiguous chunks. The order in which the chunks are processed is not specified. But the elements within each chunk, and then the results of the chunks, are reduced in their original order. So the 'reduction' function needs to be associative, but it does not need to be commutative. Compared to the non-parallel ResizeArray.reduce, the 'reduction' function is invoked a few more times to combine the results of the chunks.

reduction : 'T -> 'T -> 'T

The function to reduce a pair of elements to a single element.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T

The final result of the reductions.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

reduceBy projection reduction resizeArray

Full Usage: reduceBy projection reduction resizeArray

Parameters:
    projection : 'T -> 'U - The function to project from elements of the input ResizeArray.
    reduction : 'U -> 'U -> 'U - The function to reduce a pair of projected elements to a single element.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'U The final result of the reductions.
Type parameters: 'T, 'U

Applies a projection function to each element of the ResizeArray in parallel, reducing elements in each thread with a dedicated 'reduction' function. After processing the entire input, results from all threads are reduced together. Raises ArgumentException if the ResizeArray is empty. The ResizeArray is split into contiguous chunks. The order in which the chunks are processed is not specified. But the elements within each chunk, and then the results of the chunks, are reduced in their original order. So the 'reduction' function needs to be associative, but it does not need to be commutative. Compared to the non-parallel ResizeArray.reduce, the 'reduction' function is invoked a few more times to combine the results of the chunks.

projection : 'T -> 'U

The function to project from elements of the input ResizeArray.

reduction : 'U -> 'U -> 'U

The function to reduce a pair of projected elements to a single element.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'U

The final result of the reductions.

ResizeArrayTArgumentException Thrown when the input ResizeArray is empty.

sort resizeArray

Full Usage: sort resizeArray

Parameters:
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> A new sorted ResizeArray.
Type parameters: 'T (requires comparison)

Sorts the elements of a ResizeArray in parallel, returning a new ResizeArray. Elements are compared using Operators.compare. This means "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T>

A new sorted ResizeArray.

sortBy projection resizeArray

Full Usage: sortBy projection resizeArray

Parameters:
    projection : 'T -> 'Key - The function to transform ResizeArray elements into the type that is compared.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> The sorted ResizeArray.
Type parameters: 'T, 'Key (requires comparison)

Sorts the elements of a ResizeArray in parallel, using the given projection for the keys and returning a new ResizeArray. Elements are compared using Operators.compare. This means "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The projection is applied to each element exactly once, in parallel. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

projection : 'T -> 'Key

The function to transform ResizeArray elements into the type that is compared.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T>

The sorted ResizeArray.

sortByDescending projection resizeArray

Full Usage: sortByDescending projection resizeArray

Parameters:
    projection : 'T -> 'Key - The function to transform ResizeArray elements into the type that is compared.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> The sorted ResizeArray.
Type parameters: 'T, 'Key (requires comparison)

Sorts the elements of a ResizeArray in parallel, in descending order, using the given projection for the keys and returning a new ResizeArray. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The projection is applied to each element exactly once, in parallel. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

projection : 'T -> 'Key

The function to transform ResizeArray elements into the type that is compared.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T>

The sorted ResizeArray.

sortDescending resizeArray

Full Usage: sortDescending resizeArray

Parameters:
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> The sorted ResizeArray.
Type parameters: 'T (requires comparison)

Sorts the elements of a ResizeArray in parallel, in descending order, returning a new ResizeArray. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T>

The sorted ResizeArray.

sortInPlace resizeArray

Full Usage: sortInPlace resizeArray

Parameters:
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Type parameters: 'T (requires comparison)

Sorts the elements of a ResizeArray in place in parallel, using generic comparison. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The elements are sorted in a temporary array and then copied back into the ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

resizeArray : ResizeArray<'T>

The input ResizeArray.

sortInPlaceBy projection resizeArray

Full Usage: sortInPlaceBy projection resizeArray

Parameters:
    projection : 'T -> 'Key - The function to transform ResizeArray elements into the type that is compared.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Type parameters: 'T, 'Key (requires comparison)

Sorts the elements of a ResizeArray in place in parallel, using the given projection for the keys. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The projection is applied to each element exactly once, in parallel. The elements are sorted in a temporary array and then copied back into the ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

projection : 'T -> 'Key

The function to transform ResizeArray elements into the type that is compared.

resizeArray : ResizeArray<'T>

The input ResizeArray.

sortInPlaceWith comparer resizeArray

Full Usage: sortInPlaceWith comparer resizeArray

Parameters:
    comparer : 'T -> 'T -> int - The function to compare pairs of ResizeArray elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Type parameters: 'T

Sorts the elements of a ResizeArray in place in parallel, using the given comparison function as the order. The elements are sorted in a temporary array and then copied back into the ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

comparer : 'T -> 'T -> int

The function to compare pairs of ResizeArray elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

sortWith comparer resizeArray

Full Usage: sortWith comparer resizeArray

Parameters:
    comparer : 'T -> 'T -> int - The function to compare pairs of ResizeArray elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ResizeArray<'T> The sorted ResizeArray.
Type parameters: 'T

Sorts the elements of a ResizeArray in parallel, using the given comparison function as the order, returning a new ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

comparer : 'T -> 'T -> int

The function to compare pairs of ResizeArray elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ResizeArray<'T>

The sorted ResizeArray.

sum resizeArray

Full Usage: sum resizeArray

Parameters:
    resizeArray : ResizeArray<^T> - The input ResizeArray.

Returns: ^T The resulting sum.
Modifiers: inline
Type parameters: ^T (requires (static member get_Zero : -> ^T) and (static member op_Addition : ^T * ^T -> ^T))

Returns the sum of the elements in the ResizeArray. Returns zero for an empty ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.sum, because the elements are added in a different order.

resizeArray : ResizeArray<^T>

The input ResizeArray.

Returns: ^T

The resulting sum.

sumBy projection resizeArray

Full Usage: sumBy projection resizeArray

Parameters:
    projection : 'T -> ^Key - The function to transform the ResizeArray elements into the type to be summed.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: ^Key The resulting sum.
Modifiers: inline
Type parameters: 'T, ^Key (requires (static member get_Zero : -> ^Key) and (static member op_Addition : ^Key * ^Key -> ^Key))

Returns the sum of the results generated by applying the function to each element of the ResizeArray. Returns zero for an empty ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.sumBy, because the elements are added in a different order.

projection : 'T -> ^Key

The function to transform the ResizeArray elements into the type to be summed.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: ^Key

The resulting sum.

tryFind predicate resizeArray

Full Usage: tryFind predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'T option The first element that satisfies the predicate, or None.
Type parameters: 'T

Returns the first element for which the given function returns true. Returns None if no such element exists. The predicate is applied to the elements of the input ResizeArray in parallel. Once an element satisfies the predicate, no further elements after it are tested, at system's earliest convenience.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'T option

The first element that satisfies the predicate, or None.

tryFindIndex predicate resizeArray

Full Usage: tryFindIndex predicate resizeArray

Parameters:
    predicate : 'T -> bool - The function to test the input elements.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: int option The index of the first element that satisfies the predicate, or None.
Type parameters: 'T

Returns the index of the first element in the ResizeArray that satisfies the given predicate. Returns None if no such element exists. The predicate is applied to the elements of the input ResizeArray in parallel. Once an element satisfies the predicate, no further elements after it are tested, at system's earliest convenience.

predicate : 'T -> bool

The function to test the input elements.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: int option

The index of the first element that satisfies the predicate, or None.

tryPick chooser resizeArray

Full Usage: tryPick chooser resizeArray

Parameters:
    chooser : 'T -> 'U option - The function to transform the ResizeArray elements into options.
    resizeArray : ResizeArray<'T> - The input ResizeArray.

Returns: 'U option The first transformed element that is Some(x).
Type parameters: 'T, 'U

Applies the given function to successive elements, returning the first result where the function returns Some(x) for some x. If the function never returns Some(x) then None is returned. The chooser is applied to the elements of the input ResizeArray in parallel. Once it returns Some(x), no further elements after it are tested, at system's earliest convenience.

chooser : 'T -> 'U option

The function to transform the ResizeArray elements into options.

resizeArray : ResizeArray<'T>

The input ResizeArray.

Returns: 'U option

The first transformed element that is Some(x).

zip resizeArray1 resizeArray2

Full Usage: zip resizeArray1 resizeArray2

Parameters:
    resizeArray1 : ResizeArray<'T> - The first input ResizeArray.
    resizeArray2 : ResizeArray<'U> - The second input ResizeArray.

Returns: ResizeArray<'T * 'U> The ResizeArray of tupled elements.
Type parameters: 'T, 'U

Combines the two ResizeArrays into a ResizeArray of pairs. The two ResizeArrays must have equal lengths, otherwise an ArgumentException is raised. Performs the operation in parallel using Parallel.For.

resizeArray1 : ResizeArray<'T>

The first input ResizeArray.

resizeArray2 : ResizeArray<'U>

The second input ResizeArray.

Returns: ResizeArray<'T * 'U>

The ResizeArray of tupled elements.

ResizeArrayTArgumentException Thrown when the input ResizeArrays differ in length.

Type something to start searching.