Parallel operations on IEnumerables.
Function or value | Description | ||||
Full Usage:
PSeq.append source1 source2
Parameters:
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.
|
||||
Full Usage:
PSeq.average source
Parameters:
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
|
||||
Full Usage:
PSeq.averageBy projection source
Parameters:
'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
|
||||
Full Usage:
PSeq.cache source
Parameters:
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.
|
||||
Full Usage:
PSeq.cast source
Parameters:
IEnumerable
-
The input sequence.
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.
|
||||
Full Usage:
PSeq.choose chooser source
Parameters:
'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.
|
||||
Full Usage:
PSeq.collect mapping source
Parameters:
'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.
|
||||
Full Usage:
PSeq.concat sources
Parameters:
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.
|
||||
Full Usage:
PSeq.countBy projection source
Parameters:
'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.
|
||||
Full Usage:
PSeq.distinct source
Parameters:
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.
|
||||
Full Usage:
PSeq.distinctBy projection source
Parameters:
'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.
|
||||
|
|
||||
Full Usage:
PSeq.exists predicate source
Parameters:
'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.
|
||||
Full Usage:
PSeq.exists2 predicate source1 source2
Parameters:
'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.
|
||||
Full Usage:
PSeq.filter predicate source
Parameters:
'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.
|
||||
Full Usage:
PSeq.find predicate source
Parameters:
'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
|
||||
Full Usage:
PSeq.findIndex predicate source
Parameters:
'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
|
||||
Full Usage:
PSeq.fold folder state source
Parameters:
'State -> 'T -> 'State
-
A function that updates the state with each element from the sequence.
state : 'State
-
The initial state.
source : 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
|
||||
Full Usage:
PSeq.forall predicate source
Parameters:
'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.
|
||||
Full Usage:
PSeq.forall2 predicate source1 source2
Parameters:
'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.
|
||||
Full Usage:
PSeq.groupBy projection source
Parameters:
'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.
|
||||
Full Usage:
PSeq.head source
Parameters:
seq<'T>
-
The input sequence.
Returns: 'T
The result sequence.
|
|
||||
Full Usage:
PSeq.init count initializer
Parameters:
int
-
The maximum number of items to generate for the sequence.
initializer : int -> 'T
-
A function that generates an item in the sequence from a given index.
Returns: 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.
|
||||
Full Usage:
PSeq.isEmpty source
Parameters:
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.
|
||||
Full Usage:
PSeq.iter action source
Parameters:
'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.
|
||||
Full Usage:
PSeq.iter2 action source1 source2
Parameters:
'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.
|
||||
Full Usage:
PSeq.iteri action source
Parameters:
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.
|
||||
Full Usage:
PSeq.length source
Parameters:
seq<'T>
-
The input sequence.
Returns: int
The result sequence.
|
|
||||
Full Usage:
PSeq.map mapping source
Parameters:
'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 The returned sequence may be passed between threads safely. However, individual IEnumerator values generated from the returned sequence should not be accessed concurrently.
|
||||
Full Usage:
PSeq.map2 mapping source1 source2
Parameters:
'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.
|
||||
Full Usage:
PSeq.mapi mapping source
Parameters:
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.
|
||||
Full Usage:
PSeq.max source
Parameters:
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
|
||||
Full Usage:
PSeq.maxBy projection source
Parameters:
^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.
|
||||
Full Usage:
PSeq.min source
Parameters:
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
|
||||
Full Usage:
PSeq.minBy projection source
Parameters:
^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.
|
||||
Full Usage:
PSeq.nth index source
Parameters:
int
-
The index of element to retrieve.
source : seq<'T>
-
The input sequence.
Returns: 'T
The result sequence.
|
|
||||
Full Usage:
PSeq.ofArray source
Parameters:
'T array
-
The input array.
Returns: pseq<'T>
The result sequence.
|
|
||||
Full Usage:
PSeq.ofList source
Parameters:
'T list
-
The input list.
Returns: pseq<'T>
The result sequence.
|
|
||||
|
|
||||
Full Usage:
PSeq.pick chooser source
Parameters:
'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
|
||||
Full Usage:
PSeq.reduce reduction source
Parameters:
'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.
|
||||
Full Usage:
PSeq.singleton value
Parameters:
'T
-
The input item.
Returns: pseq<'T>
The result sequence.
|
|
||||
Full Usage:
PSeq.skip count source
Parameters:
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.
|
||||
Full Usage:
PSeq.skipWhile predicate source
Parameters:
'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
|
||||
Full Usage:
PSeq.sort source
Parameters:
seq<'T>
-
The input sequence.
Returns: pseq<'T>
The result sequence.
|
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.
|
||||
Full Usage:
PSeq.sortBy projection source
Parameters:
'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 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.
|
||||
Full Usage:
PSeq.sum source
Parameters:
seq<^T>
-
The input sequence.
Returns: ^T
The result sequence.
|
The elements are summed using the
|
||||
Full Usage:
PSeq.sumBy projection source
Parameters:
'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
|
||||
Full Usage:
PSeq.takeWhile predicate source
Parameters:
'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
|
||||
Full Usage:
PSeq.toArray source
Parameters:
seq<'T>
-
The input sequence.
Returns: 'T array
The result sequence.
|
|
||||
Full Usage:
PSeq.toList source
Parameters:
seq<'T>
-
The input sequence.
Returns: 'T list
The result sequence.
|
|
||||
Full Usage:
PSeq.truncate count source
Parameters:
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.
|
||||
Full Usage:
PSeq.tryFind predicate source
Parameters:
'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
|
||||
Full Usage:
PSeq.tryFindIndex predicate source
Parameters:
'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
|
||||
Full Usage:
PSeq.withCancellation cancellationToken source
Parameters:
CancellationToken
source : seq<'T>
Returns: pseq<'T>
|
|
||||
Full Usage:
PSeq.withDegreeOfParallelism n source
Parameters:
int
source : seq<'T>
Returns: pseq<'T>
|
|
||||
Full Usage:
PSeq.withExecutionMode executionMode source
Parameters:
ParallelExecutionMode
source : seq<'T>
Returns: pseq<'T>
|
|
||||
Full Usage:
PSeq.withMergeOptions mergeOptions source
Parameters:
ParallelMergeOptions
source : seq<'T>
Returns: pseq<'T>
|
|
||||
Full Usage:
PSeq.zip source1 source2
Parameters:
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.
|