Additional operations on Seq
Function or value | Description | ||
Full Usage:
Seq.apply f x
Parameters:
('a -> 'b) seq
-
The seq of functions.
x : 'a seq
-
The seq of values.
Returns: 'b seq
A seq concatenating the results from applying each function to each value.
|
Example
module Seq
from Microsoft.FSharp.Collections
Multiple items
val double: value: 'T -> double (requires member op_Explicit) -------------------- type double = System.Double -------------------- type double<'Measure> = float<'Measure> Multiple items
val seq: sequence: 'T seq -> 'T seq -------------------- type 'T seq = System.Collections.Generic.IEnumerable<'T> Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int |
||
Full Usage:
Seq.bind mapping source
Parameters:
'T -> 'U seq
-
A function to transform elements of the input sequence into the sequences
that will then be concatenated.
source : 'T seq
-
The input sequence.
Returns: 'U seq
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 : 'a seq
-
The input seq.
Returns: 'b seq
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 : 'T seq
-
The input seq.
Returns: ('Key * ResizeArray<'T>) seq
The resulting sequence of keys tupled with an array of matching 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 : 'b seq
-
The input sequence.
Returns: 'b seq
The result sequence.
|
When count exceeds the number of elements in the sequence it returns an empty sequence instead of throwing an exception.
|
||
Full Usage:
Seq.findLastSliceIndex slice source
Parameters:
'b seq
source : 'b seq
Returns: int
The index of the slice.
|
It is assumed that both the slice and the source are finite, otherwise it will not return forever. Both the slice and the source will always be iterated to the end.
|
||
Full Usage:
Seq.findSliceIndex slice source
Parameters:
'b seq
source : 'b seq
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 folder source state
Parameters:
'f -> 'g -> 'g
-
The function to update the state given the input elements.
source : 'f seq
-
The input sequence.
state : 'g
-
The initial state.
Returns: 'g
|
Note: this function has since been added to FSharp.Core. It will be removed in next major release of FSharpPlus.
|
||
Full Usage:
Seq.intercalate separator source
Parameters:
'b seq
source : 'c seq
Returns: 'b seq
|
|||
Full Usage:
Seq.intersperse sep list
Parameters:
'a
list : 'a seq
Returns: 'a seq
|
|||
Full Usage:
Seq.lift2 f x1 x2
Parameters:
'b -> 'c -> 'd
x1 : 'b seq
x2 : 'c seq
Returns: 'd seq
|
|||
Full Usage:
Seq.lift3 f x1 x2 x3
Parameters:
'b -> 'c -> 'd -> 'e
-
Mapping function taking three element combination as input.
x1 : 'd seq
-
First seq.
x2 : 'b seq
-
Second seq.
x3 : 'c seq
-
Third seq.
Returns: 'e seq
Seq with values returned from mapping function.
|
|||
Full Usage:
Seq.replace oldValue newValue source
Parameters:
'T seq
newValue : 'T seq
source : 'T seq
Returns: 'T seq
|
|||
Full Usage:
Seq.replicate count initial
Parameters:
int
-
The number of elements to replicate.
initial : 'g
-
The value to replicate
Returns: IEnumerable<'g>
The generated sequence.
|
Note: this function has since been added to FSharp.Core. It will be removed in next major release of FSharpPlus.
|
||
Full Usage:
Seq.split separators source
Parameters:
'b seq
source : 'c seq
Returns: 'c seq seq
|
|||
Full Usage:
Seq.toIReadOnlyList source
Parameters:
'a seq
-
The seq source
Returns: IReadOnlyList<'a>
The seq converted to a System.Collections.Generic.IReadOnlyList
|
|
||
Full Usage:
Seq.tryFindLastSliceIndex slice source
Parameters:
'b seq
source : 'b seq
Returns: int option
The index of the slice or None .
|
It is assumed that both the slice and the source are finite, otherwise it will not return forever. Both the slice and the source will always be iterated to the end.
|
||
Full Usage:
Seq.tryFindSliceIndex slice source
Parameters:
'b seq
source : 'b seq
Returns: int option
The index of the slice or None .
|
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.
|