Additional operations on Seq
Function or value | Description | ||
Full Usage:
Seq.apply f x
Parameters:
seq<('a -> 'b)>
-
The seq of functions.
x : seq<'a>
-
The seq of values.
Returns: seq<'b>
A seq concatenating the results from applying each function to each value.
|
Example
|
||
Full Usage:
Seq.bind mapping source
Parameters:
'T -> seq<'U>
-
A function to transform elements of the input sequence into the sequences
that will then be concatenated.
source : seq<'T>
-
The input sequence.
Returns: seq<'U>
The result sequence.
|
Remember sequence is lazy, effects are delayed until it is enumerated.This is the same as Seq.collect but the type of the mapping function is not flexible.
|
||
Full Usage:
Seq.choosei mapping source
Parameters:
int -> 'a -> 'b option
-
The mapping function, taking index and element as parameters.
source : seq<'a>
-
The input seq.
Returns: seq<'b>
Seq with values x for each List value where the function returns Some(x).
|
|
||
Full Usage:
Seq.chunkBy projection source
Parameters:
'T -> 'Key
-
A function that transforms an element of the sequence into a comparable key.
source : seq<'T>
-
The input seq.
Returns: seq<'Key * ResizeArray<'T>>
The resulting sequence of keys tupled with an array of matching values
|
![]() ![]() ![]() ![]() ![]() ![]() Chunks the seq up into groups with the same projected key by applying the key-generating projection function to each element and yielding a sequence of keys tupled with values. Each key is tupled with an array of all adjacent elements that match to the key, therefore keys are not unique but can't be adjacent as each time the key changes a new group is yield. The ordering of the original sequence is respected.
|
||
Full Usage:
Seq.drop count source
Parameters:
int
-
The number of items to drop.
source : seq<'b>
-
The input sequence.
Returns: seq<'b>
The result sequence.
|
![]() ![]() ![]() ![]() ![]() ![]() Returns a sequence that drops N elements of the original sequence and then yields the remaining elements of the sequence. When count exceeds the number of elements in the sequence it returns an empty sequence instead of throwing an exception.
|
||
Full Usage:
Seq.findSliceIndex slice source
Parameters:
seq<'b>
source : seq<'b>
Returns: int
The index of the slice.
|
It is assumed that 1) the slice is finite and 2) either the source is finite or actually contains the slice, otherwise it will not return forever. The slice will always be iterated to the end. The source will be iterated until the slice is found or it reaches the end.
|
||
Full Usage:
Seq.foldBack f x z
Parameters:
'f -> 'g -> 'g
x : seq<'f>
z : 'g
Returns: 'g
|
![]() ![]() ![]() ![]() ![]() ![]() Applies a function to each element of the collection, starting from the end, threading an accumulator argument through the computation. Note: this function has since been added to FSharpCore, so effectively overrides it. It will be removed in next major release of FSharpPlus.
|
||
Full Usage:
Seq.intercalate separator source
Parameters:
seq<'b>
source : seq<'c>
Returns: seq<'b>
|
|
||
Full Usage:
Seq.intersperse sep list
Parameters:
'a
list : seq<'a>
Returns: seq<'a>
|
![]() ![]() ![]() ![]() ![]() ![]() Inserts a separator element between each element in the source seq. http://codebetter.com/matthewpodwysocki/2009/05/06/functionally-implementing-intersperse/
|
||
Full Usage:
Seq.lift2 f x1 x2
Parameters:
'b -> 'c -> 'd
x1 : seq<'b>
x2 : seq<'c>
Returns: seq<'d>
|
|
||
Full Usage:
Seq.lift3 f x1 x2 x3
Parameters:
'b -> 'c -> 'd -> 'e
-
Mapping function taking three element combination as input.
x1 : seq<'d>
-
First seq.
x2 : seq<'b>
-
Second seq.
x3 : seq<'c>
-
Third seq.
Returns: seq<'e>
Seq with values returned from mapping function.
|
|
||
Full Usage:
Seq.replace oldValue newValue source
Parameters:
seq<'T>
newValue : seq<'T>
source : seq<'T>
Returns: seq<'T>
|
|
||
Full Usage:
Seq.replicate count initial
Parameters:
int
initial : 'g
Returns: IEnumerable<'g>
|
Note: this function has since been added to FSharpCore, so effectively overrides it. It will be removed in next major release of FSharpPlus.
|
||
Full Usage:
Seq.split separators source
Parameters:
seq<'b>
source : seq<'c>
Returns: seq<seq<'c>>
|
|
||
Full Usage:
Seq.toIReadOnlyList source
Parameters:
seq<'a>
-
The seq source
Returns: IReadOnlyList<'a>
The seq converted to a System.Collections.Generic.IReadOnlyList
|
|
||
Full Usage:
Seq.tryFindSliceIndex slice source
Parameters:
seq<'b>
source : seq<'b>
Returns: int option
The index of the slice or None .
|
![]() ![]() ![]() ![]() ![]() ![]()
Gets the index of the first occurrence of the specified slice in the source.
Returns It is assumed that 1) the slice is finite and 2) either the source is finite or actually contains the slice, otherwise it will not return forever. The slice will always be iterated to the end. The source will be iterated until the slice is found or it reaches the end.
|