FSharp.Collections.ParallelSeq


PSeq Module

Parallel operations on IEnumerables.

Functions and values

Function or value Description

PSeq.append source1 source2

Full Usage: PSeq.append source1 source2

Parameters:
    source1 : seq<'T> - The first sequence.
    source2 : seq<'T> - The second sequence.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Wraps the two given enumerations as a single concatenated enumeration.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

source1 : seq<'T>

The first sequence.

source2 : seq<'T>

The second sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when either of the two provided sequences is null.

PSeq.average source

Full Usage: PSeq.average source

Parameters:
    source : seq<^T> - The input sequence.

Returns: ^T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the average of the elements in the sequence.

The elements are averaged using the + operator, DivideByInt method and Zero property associated with the element type.

source : seq<^T>

The input sequence.

Returns: ^T

The result sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input sequence has zero elements.

PSeq.averageBy projection source

Full Usage: PSeq.averageBy projection source

Parameters:
    projection : 'T -> ^U - A function applied to transform each element of the sequence.
    source : seq<'T> - The input sequence.

Returns: ^U The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the average of the results generated by applying the function to each element of the sequence.

The elements are averaged using the + operator, DivideByInt method and Zero property associated with the generated type.

projection : 'T -> ^U

A function applied to transform each element of the sequence.

source : seq<'T>

The input sequence.

Returns: ^U

The result sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input sequence has zero elements.

PSeq.cache source

Full Usage: PSeq.cache source

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

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that corresponds to a cached version of the input sequence. This result sequence will have the same elements as the input sequence. The result can be enumerated multiple times. The input sequence will be enumerated at most once and only as far as is necessary. Caching a sequence is typically useful when repeatedly evaluating items in the original sequence is computationally expensive or if iterating the sequence causes side-effects that the user does not want to be repeated multiple times. Enumeration of the result sequence is thread safe in the sense that multiple independent IEnumerator values may be used simultaneously from different threads (accesses to the internal lookaside table are thread safe). Each individual IEnumerator is not typically thread safe and should not be accessed concurrently.

Once enumeration of the input sequence has started, it'source enumerator will be kept live by this object until the enumeration has completed. At that point, the enumerator will be disposed. The enumerator may be disposed and underlying cache storage released by converting the returned sequence object to type IDisposable, and calling the Dispose method on this object. The sequence object may then be re-enumerated and a fresh enumerator will be used.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.cast source

Full Usage: PSeq.cast source

Parameters:
Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Wraps a loosely-typed System.Collections sequence as a typed sequence.

The use of this function usually requires a type annotation. An incorrect type annotation may result in runtime type errors. Individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

source : IEnumerable

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.choose chooser source

Full Usage: PSeq.choose chooser source

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

Returns: pseq<'U> The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the list. Return the list comprised of the results "x" for each element where the function returns Some(x).

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

chooser : 'T -> 'U option

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

source : seq<'T>

The input sequence of type T.

Returns: pseq<'U>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.collect mapping source

Full Usage: PSeq.collect mapping source

Parameters:
    mapping : 'T -> 'Collection - A function to transform elements of the input sequence into the sequences that will then be concatenated.
    source : seq<'T> - The input sequence.

Returns: pseq<'U> The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the sequence and concatenates all the results.

Remember sequence is lazy, effects are delayed until it is enumerated.

mapping : 'T -> 'Collection

A function to transform elements of the input sequence into the sequences that will then be concatenated.

source : seq<'T>

The input sequence.

Returns: pseq<'U>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.concat sources

Full Usage: PSeq.concat sources

Parameters:
    sources : seq<'Collection> - The input enumeration-of-enumerations.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Combines the given enumeration-of-enumerations as a single concatenated enumeration.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

sources : seq<'Collection>

The input enumeration-of-enumerations.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.countBy projection source

Full Usage: PSeq.countBy projection source

Parameters:
    projection : 'T -> 'Key - A function transforming each item of input sequence into a key to be compared against the others.
    source : seq<'T> - The input sequence.

Returns: pseq<'Key * int> The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies a key-generating function to each element of a sequence and return a sequence yielding unique keys and their number of occurrences in the original sequence.

Note that this function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence.

projection : 'T -> 'Key

A function transforming each item of input sequence into a key to be compared against the others.

source : seq<'T>

The input sequence.

Returns: pseq<'Key * int>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.distinct source

Full Usage: PSeq.distinct source

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

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the sequence then the later occurrences are discarded.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.distinctBy projection source

Full Usage: PSeq.distinctBy projection source

Parameters:
    projection : 'T -> 'Key - A function transforming the sequence items into comparable keys.
    source : seq<'T> - The input sequence.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that contains no duplicate entries according to the generic hash and equality comparisons on the keys returned by the given key-generating function. If an element occurs multiple times in the sequence then the later occurrences are discarded.

projection : 'T -> 'Key

A function transforming the sequence items into comparable keys.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.empty

Full Usage: PSeq.empty

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Creates an empty sequence.

Returns: pseq<'T>

The result sequence.

PSeq.exists predicate source

Full Usage: PSeq.exists predicate source

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

Returns: bool The result sequence.

Operates in parallel, using System.Linq.Parallel. Tests if any element of the sequence satisfies the given predicate.

The predicate is applied to the elements of the input sequence. If any application returns true then the overall result is true and no further elements are tested. Otherwise, false is returned.

predicate : 'T -> bool

A function to test each item of the input sequence.

source : seq<'T>

The input sequence.

Returns: bool

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.exists2 predicate source1 source2

Full Usage: PSeq.exists2 predicate source1 source2

Parameters:
    predicate : 'T1 -> 'T2 -> bool - A function to test each pair of items from the input sequences.
    source1 : seq<'T1> - The first input sequence.
    source2 : seq<'T2> - The second input sequence.

Returns: bool The result sequence.

Operates in parallel, using System.Linq.Parallel. Tests if any pair of corresponding elements of the input sequences satisfies the given predicate.

The predicate is applied to matching elements in the two sequences up to the lesser of the two lengths of the collections. If any application returns true then the overall result is true and no further elements are tested. Otherwise, false is returned. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored.

predicate : 'T1 -> 'T2 -> bool

A function to test each pair of items from the input sequences.

source1 : seq<'T1>

The first input sequence.

source2 : seq<'T2>

The second input sequence.

Returns: bool

The result sequence.

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

PSeq.filter predicate source

Full Usage: PSeq.filter predicate source

Parameters:
    predicate : 'T -> bool - A function to test whether each item in the input sequence should be included in the output.
    source : seq<'T> - The input sequence.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a new collection containing only the elements of the collection for which the given predicate returns "true".

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently. Remember sequence is lazy, effects are delayed until it is enumerated.

predicate : 'T -> bool

A function to test whether each item in the input sequence should be included in the output.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.find predicate source

Full Usage: PSeq.find predicate source

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

Returns: 'T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the first element for which the given function returns true.

predicate : 'T -> bool

A function to test whether an item in the sequence should be returned.

source : seq<'T>

The input sequence.

Returns: 'T

The result sequence.

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

PSeq.findIndex predicate source

Full Usage: PSeq.findIndex predicate source

Parameters:
    predicate : 'T -> bool - A function to test whether the index of a particular element should be returned.
    source : seq<'T> - The input sequence.

Returns: int The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the index of the first element for which the given function returns true.

predicate : 'T -> bool

A function to test whether the index of a particular element should be returned.

source : seq<'T>

The input sequence.

Returns: int

The result sequence.

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

PSeq.fold folder state source

Full Usage: PSeq.fold 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 : seq<'T> - The input sequence.

Returns: 'State The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies a function to each element of the collection, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f (... (f source i0)...) iN

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

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

state : 'State

The initial state.

source : seq<'T>

The input sequence.

Returns: 'State

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.forall predicate source

Full Usage: PSeq.forall predicate source

Parameters:
    predicate : 'T -> bool - A function to test an element of the input sequence.
    source : seq<'T> - The input sequence.

Returns: bool The result sequence.

Operates in parallel, using System.Linq.Parallel. Tests if all elements of the sequence satisfy the given predicate.

The predicate is applied to the elements of the input sequence. If any application returns false then the overall result is false and no further elements are tested. Otherwise, true is returned.

predicate : 'T -> bool

A function to test an element of the input sequence.

source : seq<'T>

The input sequence.

Returns: bool

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.forall2 predicate source1 source2

Full Usage: PSeq.forall2 predicate source1 source2

Parameters:
    predicate : 'T1 -> 'T2 -> bool - A function to test pairs of elements from the input sequences.
    source1 : seq<'T1> - The first input sequence.
    source2 : seq<'T2> - The second input sequence.

Returns: bool The result sequence.

Operates in parallel, using System.Linq.Parallel. Tests the all pairs of elements drawn from the two sequences satisfy the given predicate. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored.

predicate : 'T1 -> 'T2 -> bool

A function to test pairs of elements from the input sequences.

source1 : seq<'T1>

The first input sequence.

source2 : seq<'T2>

The second input sequence.

Returns: bool

The result sequence.

ArgumentNullException Thrown when either of the input sequences is null.

PSeq.groupBy projection source

Full Usage: PSeq.groupBy projection source

Parameters:
    projection : 'T -> 'Key - A function that transforms an element of the sequence into a comparable key.
    source : seq<'T> - The input sequence.

Returns: pseq<'Key * seq<'T>> The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies a key-generating function to each element of a sequence and yields a sequence of unique keys. Each unique key has also contains a sequence of all elements that match to this key.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence.

projection : 'T -> 'Key

A function that transforms an element of the sequence into a comparable key.

source : seq<'T>

The input sequence.

Returns: pseq<'Key * seq<'T>>

The result sequence.

PSeq.head source

Full Usage: PSeq.head source

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

Returns: 'T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the first element of the sequence.

source : seq<'T>

The input sequence.

Returns: 'T

The result sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input does not have any elements.

PSeq.init count initializer

Full Usage: PSeq.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: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Generates a new sequence which, when iterated, will return successive elements by calling the given function, up to the given count. The results of calling the function will not be saved, that is the function will be reapplied as necessary to regenerate the elements. The function is passed the index of the item being generated.

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: pseq<'T>

The result sequence.

ArgumentException Thrown when count is negative.

PSeq.isEmpty source

Full Usage: PSeq.isEmpty source

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

Returns: bool The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns true if the sequence contains no elements, false otherwise.

source : seq<'T>

The input sequence.

Returns: bool

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.iter action source

Full Usage: PSeq.iter action source

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

Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the collection.

action : 'T -> unit

A function to apply to each element of the sequence.

source : seq<'T>

The input sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.iter2 action source1 source2

Full Usage: PSeq.iter2 action source1 source2

Parameters:
    action : 'T1 -> 'T2 -> unit - A function to apply to each pair of elements from the input sequences.
    source1 : seq<'T1> - The first input sequence.
    source2 : seq<'T2> - The second input sequence.

Operates in parallel, using System.Linq.Parallel. Applies the given function to two collections simultaneously. If one sequence is shorter than the other then the remaining elements of the longer sequence are ignored.

action : 'T1 -> 'T2 -> unit

A function to apply to each pair of elements from the input sequences.

source1 : seq<'T1>

The first input sequence.

source2 : seq<'T2>

The second input sequence.

ArgumentNullException Thrown when either of the input sequences is null.

PSeq.iteri action source

Full Usage: PSeq.iteri action source

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

Operates in parallel, using System.Linq.Parallel. Applies the given function to each element of the collection. The integer passed to the function indicates the index of element.

action : int -> 'T -> unit

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

source : seq<'T>

The input sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.length source

Full Usage: PSeq.length source

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

Returns: int The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the lengthof the sequence

source : seq<'T>

The input sequence.

Returns: int

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.map mapping source

Full Usage: PSeq.map mapping source

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

Returns: pseq<'U> The result sequence.

Operates in parallel, using System.Linq.Parallel. Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The given function will be applied as elements are demanded using the MoveNext method on enumerators retrieved from the object.

The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.

mapping : 'T -> 'U

A function to transform items from the input sequence.

source : seq<'T>

The input sequence.

Returns: pseq<'U>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.map2 mapping source1 source2

Full Usage: PSeq.map2 mapping source1 source2

Parameters:
    mapping : 'T1 -> 'T2 -> 'U - A function to transform pairs of items from the input sequences.
    source1 : seq<'T1> - The first input sequence.
    source2 : seq<'T2> - The second input sequence.

Returns: pseq<'U> The result sequence.

Operates in parallel, using System.Linq.Parallel. Builds a new collection whose elements are the results of applying the given function to the corresponding pairs of elements from the two sequences. If one input sequence is shorter than the other then the remaining elements of the longer sequence are ignored.

mapping : 'T1 -> 'T2 -> 'U

A function to transform pairs of items from the input sequences.

source1 : seq<'T1>

The first input sequence.

source2 : seq<'T2>

The second input sequence.

Returns: pseq<'U>

The result sequence.

ArgumentNullException Thrown when either of the input sequences is null.

PSeq.mapi mapping source

Full Usage: PSeq.mapi mapping source

Parameters:
    mapping : int -> 'T -> 'U - A function to transform items from the input sequence that also supplies the current index.
    source : seq<'T> - The input sequence.

Returns: pseq<'U> The result sequence.

Operates in parallel, using System.Linq.Parallel. Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The integer index passed to the function indicates the index (from 0) of element being transformed.

mapping : int -> 'T -> 'U

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

source : seq<'T>

The input sequence.

Returns: pseq<'U>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.max source

Full Usage: PSeq.max source

Parameters:
    source : seq<^T> - The input sequence.

Returns: ^T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the greatest of all elements of the sequence, compared via Operators.max

source : seq<^T>

The input sequence.

Returns: ^T

The result sequence.

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

PSeq.maxBy projection source

Full Usage: PSeq.maxBy projection source

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

Returns: ^T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the greatest of all elements of the sequence, compared via Operators.max on the function result.

projection : ^T -> ^U

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

source : seq<^T>

The input sequence.

Returns: ^T

The result sequence.

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

PSeq.min source

Full Usage: PSeq.min source

Parameters:
    source : seq<^T> - The input sequence.

Returns: ^T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the lowest of all elements of the sequence, compared via Operators.min.

source : seq<^T>

The input sequence.

Returns: ^T

The result sequence.

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

PSeq.minBy projection source

Full Usage: PSeq.minBy projection source

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

Returns: ^T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the lowest of all elements of the sequence, compared via Operators.min on the function result.

projection : ^T -> ^U

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

source : seq<^T>

The input sequence.

Returns: ^T

The result sequence.

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

PSeq.nth index source

Full Usage: PSeq.nth index source

Parameters:
    index : int - The index of element to retrieve.
    source : seq<'T> - The input sequence.

Returns: 'T The result sequence.

Operates in parallel, using System.Linq.Parallel. Computes the nth element in the collection.

index : int

The index of element to retrieve.

source : seq<'T>

The input sequence.

Returns: 'T

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.ofArray source

Full Usage: PSeq.ofArray source

Parameters:
    source : 'T array - The input array.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Views the given array as a sequence.

source : 'T array

The input array.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.ofList source

Full Usage: PSeq.ofList source

Parameters:
    source : 'T list - The input list.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Views the given list as a sequence.

source : 'T list

The input list.

Returns: pseq<'T>

The result sequence.

PSeq.ordered source

Full Usage: PSeq.ordered source

Parameters:
    source : seq<'T>

Returns: pseq<'T>
source : seq<'T>
Returns: pseq<'T>

PSeq.pick chooser source

Full Usage: PSeq.pick chooser source

Parameters:
    chooser : 'T -> 'U option - A function to transform each item of the input sequence into an option of the output type.
    source : seq<'T> - The input sequence.

Returns: 'U The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies the given function to successive elements, returning the first x where the function returns "Some(x)".

chooser : 'T -> 'U option

A function to transform each item of the input sequence into an option of the output type.

source : seq<'T>

The input sequence.

Returns: 'U

The result sequence.

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

PSeq.reduce reduction source

Full Usage: PSeq.reduce reduction source

Parameters:
    reduction : 'T -> 'T -> 'T - A function that takes in the current accumulated result and the next element of the sequence to produce the next accumulated result.
    source : seq<'T> - The input sequence.

Returns: 'T The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies a function to each element of the sequence, threading an accumulator argument through the computation. Begin by applying the function to the first two elements. Then feed this result into the function along with the third element and so on. Return the final result.

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

A function that takes in the current accumulated result and the next element of the sequence to produce the next accumulated result.

source : seq<'T>

The input sequence.

Returns: 'T

The result sequence.

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

PSeq.singleton value

Full Usage: PSeq.singleton value

Parameters:
    value : 'T - The input item.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that yields one item only.

value : 'T

The input item.

Returns: pseq<'T>

The result sequence.

PSeq.skip count source

Full Usage: PSeq.skip count source

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

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that skips N elements of the underlying sequence and then yields the remaining elements of the sequence.

count : int

The number of items to skip.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.
InvalidOperationException Thrown when count exceeds the number of elements in the sequence.

PSeq.skipWhile predicate source

Full Usage: PSeq.skipWhile predicate source

Parameters:
    predicate : 'T -> bool - A function that evaluates an element of the sequence to a boolean value.
    source : seq<'T> - The input sequence.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that, when iterated, skips elements of the underlying sequence while the given predicate returns true, and then yields the remaining elements of the sequence.

predicate : 'T -> bool

A function that evaluates an element of the sequence to a boolean value.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.sort source

Full Usage: PSeq.sort source

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

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Yields a sequence ordered by keys.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.sortBy projection source

Full Usage: PSeq.sortBy projection source

Parameters:
    projection : 'T -> 'Key - A function to transform items of the input sequence into comparable keys.
    source : seq<'T> - The input sequence.

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Applies a key-generating function to each element of a sequence and yield a sequence ordered by keys. The keys are compared using generic comparison as implemented by Operators.compare.

This function returns a sequence that digests the whole initial sequence as soon as that sequence is iterated. As a result this function should not be used with large or infinite sequences. The function makes no assumption on the ordering of the original sequence. This is a stable sort, that is the original order of equal elements is preserved.

projection : 'T -> 'Key

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

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.sum source

Full Usage: PSeq.sum source

Parameters:
    source : seq<^T> - The input sequence.

Returns: ^T The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the sum of the elements in the sequence.

The elements are summed using the + operator and Zero property associated with the generated type.

source : seq<^T>

The input sequence.

Returns: ^T

The result sequence.

PSeq.sumBy projection source

Full Usage: PSeq.sumBy projection source

Parameters:
    projection : 'T -> ^U - A function to transform items from the input sequence into the type that will be summed.
    source : seq<'T> - The input sequence.

Returns: ^U The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the sum of the results generated by applying the function to each element of the sequence.

The generated elements are summed using the + operator and Zero property associated with the generated type.

projection : 'T -> ^U

A function to transform items from the input sequence into the type that will be summed.

source : seq<'T>

The input sequence.

Returns: ^U

The result sequence.

PSeq.takeWhile predicate source

Full Usage: PSeq.takeWhile predicate source

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

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that, when iterated, yields elements of the underlying sequence while the given predicate returns true, and then returns no further elements.

predicate : 'T -> bool

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

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.toArray source

Full Usage: PSeq.toArray source

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

Returns: 'T array The result sequence.

Operates in parallel, using System.Linq.Parallel. Builds an array from the given collection.

source : seq<'T>

The input sequence.

Returns: 'T array

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.toList source

Full Usage: PSeq.toList source

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

Returns: 'T list The result sequence.

Operates in parallel, using System.Linq.Parallel. Builds a list from the given collection.

source : seq<'T>

The input sequence.

Returns: 'T list

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.truncate count source

Full Usage: PSeq.truncate count source

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

Returns: pseq<'T> The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns a sequence that when enumerated returns at most N elements.

count : int

The maximum number of items to enumerate.

source : seq<'T>

The input sequence.

Returns: pseq<'T>

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.tryFind predicate source

Full Usage: PSeq.tryFind predicate source

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

Returns: 'T option The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the first element for which the given function returns true. Return None if no such element exists.

predicate : 'T -> bool

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

source : seq<'T>

The input sequence.

Returns: 'T option

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.tryFindIndex predicate source

Full Usage: PSeq.tryFindIndex predicate source

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

Returns: int option The result sequence.

Operates in parallel, using System.Linq.Parallel. Returns the index of the first element in the sequence that satisfies the given predicate. Return None if no such element exists.

predicate : 'T -> bool

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

source : seq<'T>

The input sequence.

Returns: int option

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

PSeq.withCancellation cancellationToken source

Full Usage: PSeq.withCancellation cancellationToken source

Parameters:
Returns: pseq<'T>
cancellationToken : CancellationToken
source : seq<'T>
Returns: pseq<'T>

PSeq.withDegreeOfParallelism n source

Full Usage: PSeq.withDegreeOfParallelism n source

Parameters:
    n : int
    source : seq<'T>

Returns: pseq<'T>
n : int
source : seq<'T>
Returns: pseq<'T>

PSeq.withExecutionMode executionMode source

Full Usage: PSeq.withExecutionMode executionMode source

Parameters:
Returns: pseq<'T>
executionMode : ParallelExecutionMode
source : seq<'T>
Returns: pseq<'T>

PSeq.withMergeOptions mergeOptions source

Full Usage: PSeq.withMergeOptions mergeOptions source

Parameters:
Returns: pseq<'T>
mergeOptions : ParallelMergeOptions
source : seq<'T>
Returns: pseq<'T>

PSeq.zip source1 source2

Full Usage: PSeq.zip source1 source2

Parameters:
    source1 : seq<'T1> - The first input sequence.
    source2 : seq<'T2> - The second input sequence.

Returns: pseq<'T1 * 'T2> The result sequence.

Operates in parallel, using System.Linq.Parallel. Combines the two sequences into a list 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 : seq<'T1>

The first input sequence.

source2 : seq<'T2>

The second input sequence.

Returns: pseq<'T1 * 'T2>

The result sequence.

ArgumentNullException Thrown when either of the input sequences is null.