Header menu logo FSharp.Core.Fluent

SeqExtensions Module

Fluent extension operations on sequences.

Types

Type Description

SeqExtensionsConstrained

Type extensions

Type extension Description

this.IsEmpty

Full Usage: this.IsEmpty

Parameters:
    () : unit

Returns: bool True if the sequence is empty; false otherwise.
Modifiers: inline

Returns true if the sequence contains no elements, false otherwise.

Extended Type: IEnumerable

() : unit
Returns: bool

True if the sequence is empty; false otherwise.

ArgumentNullException Thrown when the input sequence is null.

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool True if the sequence is empty; false otherwise.
Modifiers: inline abstract

Returns true if the sequence contains no elements, false otherwise.

Extended Type: IEnumerable

Returns: bool

True if the sequence is empty; false otherwise.

ArgumentNullException Thrown when the input sequence is null.

this[index]

Full Usage: this[index]

Parameters:
    index : int - The index of the element to retrieve.

Returns: 'T The element at the specified index of the sequence.
Modifiers: inline

Computes the element at the specified index in the collection.

Extended Type: IEnumerable

index : int

The index of the element to retrieve.

Returns: 'T

The element at the specified index of the sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the index is negative or the input sequence does not contain enough elements.

this.allPairs source2

Full Usage: this.allPairs source2

Parameters:
    source2 : 'a seq - The second input sequence.

Returns: ('T * 'a) seq The resulting sequence of pairs.
Modifiers: inline
Type parameters: 'a

Returns a new sequence that contains all pairings of elements from the first and second sequences.

Extended Type: IEnumerable

source2 : 'a seq

The second input sequence.

Returns: ('T * 'a) seq

The resulting sequence of pairs.

ArgumentException Thrown when either of the input sequences is null.

this.append source2

Full Usage: this.append source2

Parameters:
    source2 : 'T seq - The second sequence.

Returns: 'T seq The result sequence.
Modifiers: inline

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.

Extended Type: IEnumerable

source2 : 'T seq

The second sequence.

Returns: 'T seq

The result sequence.

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

this.cache ()

Full Usage: this.cache ()

Parameters:
    () : unit

Returns: 'T seq The result sequence.
Modifiers: inline

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's 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.

Extended Type: IEnumerable

() : unit
Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.choose chooser

Full Usage: this.choose chooser

Parameters:
    chooser : 'T -> 'U option - A function to transform items of type T into options of type U.

Returns: 'U seq The result sequence.
Modifiers: inline
Type parameters: 'U

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.

Extended Type: IEnumerable

chooser : 'T -> 'U option

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

Returns: 'U seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.chunkBySize chunkSize

Full Usage: this.chunkBySize chunkSize

Parameters:
    chunkSize : int - The maximum size of each chunk.

Returns: 'T[] seq The sequence divided into chunks.
Modifiers: inline

Divides the input sequence into chunks of size at most chunkSize.

Extended Type: IEnumerable

chunkSize : int

The maximum size of each chunk.

Returns: 'T[] seq

The sequence divided into chunks.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when chunkSize is not positive.

this.collect mapping

Full Usage: this.collect mapping

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

Returns: 'U seq The result sequence.
Modifiers: inline
Type parameters: 'Collection, 'U

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.

Extended Type: IEnumerable

mapping : 'T -> 'Collection

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

Returns: 'U seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.compareWith (comparer, source2)

Full Usage: this.compareWith (comparer, source2)

Parameters:
    comparer : 'T -> 'T -> int - A function that takes an element from each sequence and returns an int. If it evaluates to a non-zero value iteration is stopped and that value is returned.
    source2 : 'T seq - The second input sequence.

Returns: int The first non-zero value from the comparison function.
Modifiers: inline

Compares two sequences using the given comparison function, element by element. Returns the first non-zero result from the comparison function. If the end of a sequence is reached it returns a -1 if the first sequence is shorter and a 1 if the second sequence is shorter.

Extended Type: IEnumerable

comparer : 'T -> 'T -> int

A function that takes an element from each sequence and returns an int. If it evaluates to a non-zero value iteration is stopped and that value is returned.

source2 : 'T seq

The second input sequence.

Returns: int

The first non-zero value from the comparison function.

ArgumentNullException Thrown when either of the input sequences is null.

this.countBy projection

Full Usage: this.countBy projection

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

Returns: ('Key * int) seq The result sequence.
Modifiers: inline
Type parameters: 'Key

Applies a key-generating function to each element of a sequence and returns 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.

Extended Type: IEnumerable

projection : 'T -> 'Key

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

Returns: ('Key * int) seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.distinctBy projection

Full Usage: this.distinctBy projection

Parameters:
    projection : 'T -> 'Key - A function transforming the sequence items into comparable keys.

Returns: 'T seq The result sequence.
Modifiers: inline
Type parameters: 'Key

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.

Extended Type: IEnumerable

projection : 'T -> 'Key

A function transforming the sequence items into comparable keys.

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.exactlyOne ()

Full Usage: this.exactlyOne ()

Parameters:
    () : unit

Returns: 'T The only element of the sequence.
Modifiers: inline

Returns the only element of the sequence.

Extended Type: IEnumerable

() : unit
Returns: 'T

The only element of the sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input does not have precisely one element.

this.exists predicate

Full Usage: this.exists predicate

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

Returns: bool True if any result from the predicate is true; false otherwise.
Modifiers: inline

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.

Extended Type: IEnumerable

predicate : 'T -> bool

A function to test each item of the input sequence.

Returns: bool

True if any result from the predicate is true; false otherwise.

ArgumentNullException Thrown when the input sequence is null.

this.filter predicate

Full Usage: this.filter predicate

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

Returns: 'T seq The result sequence.
Modifiers: inline

Returns a new collection containing only the elements of the collection for which the given predicate returns "true". This is a synonym for Seq.where.

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.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.find predicate

Full Usage: this.find predicate

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

Returns: 'T The first element for which the predicate returns true.
Modifiers: inline

Returns the first element for which the given function returns true.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T

The first element for which the predicate returns true.

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

this.findBack predicate

Full Usage: this.findBack predicate

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

Returns: 'T The last element for which the predicate returns true.
Modifiers: inline

Returns the last element for which the given function returns true.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T

The last element for which the predicate returns true.

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

this.findIndex predicate

Full Usage: this.findIndex predicate

Parameters:
    predicate : 'T -> bool - A function to test whether the index of a particular element should be returned.

Returns: int The index of the first element for which the predicate returns true.
Modifiers: inline

Returns the index of the first element for which the given function returns true.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: int

The index of the first element for which the predicate returns true.

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

this.findIndexBack predicate

Full Usage: this.findIndexBack predicate

Parameters:
    predicate : 'T -> bool - A function to test whether the index of a particular element should be returned.

Returns: int The index of the last element for which the predicate returns true.
Modifiers: inline

Returns the index of the last element for which the given function returns true.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: int

The index of the last element for which the predicate returns true.

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

this.fold (state, folder)

Full Usage: this.fold (state, folder)

Parameters:
    state : 'State - The initial state.
    folder : 'State -> 'T -> 'State - A function that updates the state with each element from the sequence.

Returns: 'State The state object after the folding function is applied to each element of the sequence.
Modifiers: inline
Type parameters: 'State

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 s i0)...) iN

Extended Type: IEnumerable

state : 'State

The initial state.

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

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

Returns: 'State

The state object after the folding function is applied to each element of the sequence.

ArgumentNullException Thrown when the input sequence is null.

this.foldBack (folder, state)

Full Usage: this.foldBack (folder, state)

Parameters:
    folder : 'T -> 'State -> 'State - The function to update the state given the input elements.
    state : 'State - The initial state.

Returns: 'State The state object after the folding function is applied to each element of the sequence.
Modifiers: inline
Type parameters: 'State

Applies a function to each element of the collection, starting from the end, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f i0 (... (f iN s)...)

Extended Type: IEnumerable

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

The function to update the state given the input elements.

state : 'State

The initial state.

Returns: 'State

The state object after the folding function is applied to each element of the sequence.

ArgumentNullException Thrown when the input sequence is null.

this.forall predicate

Full Usage: this.forall predicate

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

Returns: bool True if every element of the sequence satisfies the predicate; false otherwise.
Modifiers: inline

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.

Extended Type: IEnumerable

predicate : 'T -> bool

A function to test an element of the input sequence.

Returns: bool

True if every element of the sequence satisfies the predicate; false otherwise.

ArgumentNullException Thrown when the input sequence is null.

this.groupBy projection

Full Usage: this.groupBy projection

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

Returns: ('Key * 'T seq) seq The result sequence.
Modifiers: inline
Type parameters: 'Key

Applies a key-generating function to each element of a sequence and yields a sequence of unique keys. Each unique key 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.

Extended Type: IEnumerable

projection : 'T -> 'Key

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

Returns: ('Key * 'T seq) seq

The result sequence.

this.head ()

Full Usage: this.head ()

Parameters:
    () : unit

Returns: 'T The first element of the sequence.
Modifiers: inline

Returns the first element of the sequence.

Extended Type: IEnumerable

() : unit
Returns: 'T

The first element of the sequence.

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

this.indexed ()

Full Usage: this.indexed ()

Parameters:
    () : unit

Returns: (int * 'T) seq The result sequence.
Modifiers: inline

Builds a new collection whose elements are the corresponding elements of the input collection paired with the integer index (from 0) of each element.

Extended Type: IEnumerable

() : unit
Returns: (int * 'T) seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.insertAt (index, value)

Full Usage: this.insertAt (index, value)

Parameters:
    index : int - The index where the item should be inserted.
    value : 'T - The value to insert.

Returns: 'T seq The result sequence.
Modifiers: inline

Return a new sequence with a new item inserted before the given index.

Extended Type: IEnumerable

index : int

The index where the item should be inserted.

value : 'T

The value to insert.

Returns: 'T seq

The result sequence.

ArgumentException Thrown when index is below 0 or greater than source.Length.

this.insertManyAt (index, values)

Full Usage: this.insertManyAt (index, values)

Parameters:
    index : int - The index where the items should be inserted.
    values : 'T seq - The values to insert.

Returns: 'T seq The result sequence.
Modifiers: inline

Return a new sequence with new items inserted before the given index.

Extended Type: IEnumerable

index : int

The index where the items should be inserted.

values : 'T seq

The values to insert.

Returns: 'T seq

The result sequence.

ArgumentException Thrown when index is below 0 or greater than source.Length.

this.iter action

Full Usage: this.iter action

Parameters:
    action : 'T -> unit - A function to apply to each element of the sequence.

Modifiers: inline

Applies the given function to each element of the collection.

Extended Type: IEnumerable

action : 'T -> unit

A function to apply to each element of the sequence.

ArgumentNullException Thrown when the input sequence is null.

this.iteri action

Full Usage: this.iteri action

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

Modifiers: inline

Applies the given function to each element of the collection. The integer passed to the function indicates the index of element.

Extended Type: IEnumerable

action : int -> 'T -> unit

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

ArgumentNullException Thrown when the input sequence is null.

this.last ()

Full Usage: this.last ()

Parameters:
    () : unit

Returns: 'T The last element of the sequence.
Modifiers: inline

Returns the last element of the sequence.

Extended Type: IEnumerable

() : unit
Returns: 'T

The last element of the sequence.

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

this.length ()

Full Usage: this.length ()

Parameters:
    () : unit

Returns: int The length of the sequence.
Modifiers: inline

Returns the length of the sequence

Extended Type: IEnumerable

() : unit
Returns: int

The length of the sequence.

ArgumentNullException Thrown when the input sequence is null.

this.length

Full Usage: this.length

Returns: int The length of the sequence.
Modifiers: inline abstract

Returns the length of the sequence

Extended Type: IEnumerable

Returns: int

The length of the sequence.

ArgumentNullException Thrown when the input sequence is null.

this.map mapping

Full Usage: this.map mapping

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

Returns: 'U seq The result sequence.
Modifiers: inline
Type parameters: 'U

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.

Extended Type: IEnumerable

mapping : 'T -> 'U

A function to transform items from the input sequence.

Returns: 'U seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.mapFold (state, mapping)

Full Usage: this.mapFold (state, mapping)

Parameters:
    state : 'State - The initial state.
    mapping : 'State -> 'T -> 'Result * 'State - The function to transform elements from the input collection and accumulate the final value.

Returns: 'Result seq * 'State The collection of transformed elements, and the final accumulated value.
Modifiers: inline
Type parameters: 'T, 'State, 'Result

Combines map and fold. Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The function is also used to accumulate a final value.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.

Extended Type: IEnumerable

state : 'State

The initial state.

mapping : 'State -> 'T -> 'Result * 'State

The function to transform elements from the input collection and accumulate the final value.

Returns: 'Result seq * 'State

The collection of transformed elements, and the final accumulated value.

ArgumentNullException Thrown when the input collection is null.

this.mapFoldBack (mapping, state)

Full Usage: this.mapFoldBack (mapping, state)

Parameters:
    mapping : 'T -> 'State -> 'Result * 'State - The function to transform elements from the input collection and accumulate the final value.
    state : 'State - The initial state.

Returns: 'Result seq * 'State The collection of transformed elements, and the final accumulated value.
Modifiers: inline
Type parameters: 'State, 'Result

Combines map and foldBack. Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The function is also used to accumulate a final value.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.

Extended Type: IEnumerable

mapping : 'T -> 'State -> 'Result * 'State

The function to transform elements from the input collection and accumulate the final value.

state : 'State

The initial state.

Returns: 'Result seq * 'State

The collection of transformed elements, and the final accumulated value.

ArgumentNullException Thrown when the input collection is null.

this.mapi mapping

Full Usage: this.mapi mapping

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

Returns: 'U seq The result sequence.
Modifiers: inline
Type parameters: 'U

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.

Extended Type: IEnumerable

mapping : int -> 'T -> 'U

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

Returns: 'U seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.pairwise ()

Full Usage: this.pairwise ()

Parameters:
    () : unit

Returns: ('T * 'T) seq The result sequence.
Modifiers: inline

Returns a sequence of each element in the input sequence and its predecessor, with the exception of the first element which is only returned as the predecessor of the second element.

Extended Type: IEnumerable

() : unit
Returns: ('T * 'T) seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.permute indexMap

Full Usage: this.permute indexMap

Parameters:
    indexMap : int -> int - The function that maps input indices to output indices.

Returns: 'T seq The result sequence.
Modifiers: inline

Returns a sequence with all elements permuted according to the specified permutation.

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.

Extended Type: IEnumerable

indexMap : int -> int

The function that maps input indices to output indices.

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when indexMap does not produce a valid permutation.

this.pick chooser

Full Usage: this.pick chooser

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

Returns: 'U The selected element.
Modifiers: inline
Type parameters: 'U

Applies the given function to successive elements, returning the first x where the function returns "Some(x)".

Extended Type: IEnumerable

chooser : 'T -> 'U option

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

Returns: 'U

The selected element.

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.

this.readonly ()

Full Usage: this.readonly ()

Parameters:
    () : unit

Returns: 'T seq The result sequence.
Modifiers: inline

Builds a new sequence object that delegates to the given sequence object. This ensures the original sequence cannot be rediscovered and mutated by a type cast. For example, if given an array the returned sequence will return the elements of the array, but you cannot cast the returned sequence object to an array.

Extended Type: IEnumerable

() : unit
Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.reduce reduction

Full Usage: this.reduce reduction

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.

Returns: 'T The final result of the reduction function.
Modifiers: inline

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.

Extended Type: IEnumerable

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.

Returns: 'T

The final result of the reduction function.

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

this.reduceBack reduction

Full Usage: this.reduceBack reduction

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

Returns: 'T The final result of the reductions.
Modifiers: inline

Applies a function to each element of the sequence, starting from the end, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f i0 (...(f iN-1 iN)).

Extended Type: IEnumerable

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

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

Returns: 'T

The final result of the reductions.

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

this.removeAt index

Full Usage: this.removeAt index

Parameters:
    index : int - The index of the item to be removed.

Returns: 'T seq The result sequence.
Modifiers: inline

Return a new sequence with the item at a given index removed.

Extended Type: IEnumerable

index : int

The index of the item to be removed.

Returns: 'T seq

The result sequence.

ArgumentException Thrown when index is outside 0..source.Length - 1

this.removeManyAt (index, count)

Full Usage: this.removeManyAt (index, count)

Parameters:
    index : int - The index of the item to be removed.
    count : int - The number of items to remove.

Returns: 'T seq The result sequence.
Modifiers: inline

Return a new sequence with the number of items starting at a given index removed.

Extended Type: IEnumerable

index : int

The index of the item to be removed.

count : int

The number of items to remove.

Returns: 'T seq

The result sequence.

ArgumentException Thrown when index is outside 0..source.Length - count

this.reverse ()

Full Usage: this.reverse ()

Parameters:
    () : unit

Returns: 'T seq The reversed sequence.
Modifiers: inline

Returns a new sequence with the elements in reverse order.

Extended Type: IEnumerable

() : unit
Returns: 'T seq

The reversed sequence.

ArgumentNullException Thrown when the input sequence is null.

this.scan (state, folder)

Full Usage: this.scan (state, folder)

Parameters:
    state : 'State - The initial state.
    folder : 'State -> 'T -> 'State - A function that updates the state with each element from the sequence.

Returns: 'State seq The resulting sequence of computed states.
Modifiers: inline
Type parameters: 'State

Like fold, but computes on-demand and returns the sequence of intermediary and final results.

Extended Type: IEnumerable

state : 'State

The initial state.

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

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

Returns: 'State seq

The resulting sequence of computed states.

ArgumentNullException Thrown when the input sequence is null.

this.scanBack (folder, state)

Full Usage: this.scanBack (folder, state)

Parameters:
    folder : 'T -> 'State -> 'State - A function that updates the state with each element from the sequence.
    state : 'State - The initial state.

Returns: 'State seq The resulting sequence of computed states.
Modifiers: inline
Type parameters: 'State

Like foldBack, but returns the sequence of intermediary and final results.

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.

Extended Type: IEnumerable

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

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

state : 'State

The initial state.

Returns: 'State seq

The resulting sequence of computed states.

ArgumentNullException Thrown when the input sequence is null.

this.skip count

Full Usage: this.skip count

Parameters:
    count : int - The number of items to skip.

Returns: 'T seq The result sequence.
Modifiers: inline

Returns a sequence that skips N elements of the underlying sequence and then yields the remaining elements of the sequence.

Extended Type: IEnumerable

count : int

The number of items to skip.

Returns: 'T seq

The result sequence.

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

this.skipWhile predicate

Full Usage: this.skipWhile predicate

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

Returns: 'T seq The result sequence.
Modifiers: inline

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.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.sortBy projection

Full Usage: this.sortBy projection

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

Returns: 'T seq The result sequence.
Modifiers: inline
Type parameters: 'Key

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.

Extended Type: IEnumerable

projection : 'T -> 'Key

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

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.sortByDescending projection

Full Usage: this.sortByDescending projection

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

Returns: 'T seq The result sequence.
Modifiers: inline
Type parameters: 'Key

Applies a key-generating function to each element of a sequence and yield a sequence ordered descending 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.

Extended Type: IEnumerable

projection : 'T -> 'Key

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

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.sortWith comparer

Full Usage: this.sortWith comparer

Parameters:
    comparer : 'T -> 'T -> int - The function to compare the collection elements.

Returns: 'T seq The result sequence.
Modifiers: inline

Yields a sequence ordered using the given comparison function.

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.

Extended Type: IEnumerable

comparer : 'T -> 'T -> int

The function to compare the collection elements.

Returns: 'T seq

The result sequence.

this.splitInto count

Full Usage: this.splitInto count

Parameters:
    count : int - The maximum number of chunks.

Returns: 'T[] seq The sequence split into chunks.
Modifiers: inline

Splits the input sequence into at most count chunks.

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.

Extended Type: IEnumerable

count : int

The maximum number of chunks.

Returns: 'T[] seq

The sequence split into chunks.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when count is not positive.

this.tail ()

Full Usage: this.tail ()

Parameters:
    () : unit

Returns: 'T seq The result sequence.
Modifiers: inline

Returns a sequence that skips 1 element of the underlying sequence and then yields the remaining elements of the sequence.

Extended Type: IEnumerable

() : unit
Returns: 'T seq

The result sequence.

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

this.take count

Full Usage: this.take count

Parameters:
    count : int - The number of items to take.

Returns: 'T seq The result sequence.
Modifiers: inline

Returns the first N elements of the sequence.

Throws InvalidOperationException if the count exceeds the number of elements in the sequence. Seq.truncate returns as many items as the sequence contains instead of throwing an exception.

Extended Type: IEnumerable

count : int

The number of items to take.

Returns: 'T seq

The result sequence.

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

this.takeWhile predicate

Full Usage: this.takeWhile predicate

Parameters:
    predicate : 'T -> bool - A function that evaluates to false when no more items should be returned.

Returns: 'T seq The result sequence.
Modifiers: inline

Returns a sequence that, when iterated, yields elements of the underlying sequence while the given predicate returns true, and then returns no further elements.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.toArray ()

Full Usage: this.toArray ()

Parameters:
    () : unit

Returns: 'T[] The result array.
Modifiers: inline

Builds an array from the given collection.

Extended Type: IEnumerable

() : unit
Returns: 'T[]

The result array.

ArgumentNullException Thrown when the input sequence is null.

this.toList ()

Full Usage: this.toList ()

Parameters:
    () : unit

Returns: 'T list The result list.
Modifiers: inline

Builds a list from the given collection.

Extended Type: IEnumerable

() : unit
Returns: 'T list

The result list.

ArgumentNullException Thrown when the input sequence is null.

IEnumerable.transpose source

Full Usage: IEnumerable.transpose source

Parameters:
    source : 'a seq

Returns: 'T seq seq The transposed sequence.
Modifiers: inline
Type parameters: 'a

Returns the transpose of the given sequence of sequences.

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.

Extended Type: IEnumerable

source : 'a seq
Returns: 'T seq seq

The transposed sequence.

ArgumentNullException Thrown when the input sequence is null.

this.truncate count

Full Usage: this.truncate count

Parameters:
    count : int - The maximum number of items to enumerate.

Returns: 'T seq The result sequence.
Modifiers: inline

Returns a sequence that when enumerated returns at most N elements.

Extended Type: IEnumerable

count : int

The maximum number of items to enumerate.

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.tryExactlyOne ()

Full Usage: this.tryExactlyOne ()

Parameters:
    () : unit

Returns: 'T option The only element of the sequence or None.
Modifiers: inline

Returns the only element of the sequence or None if it is empty or contains more than one element.

Extended Type: IEnumerable

() : unit
Returns: 'T option

The only element of the sequence or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryFind predicate

Full Usage: this.tryFind predicate

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

Returns: 'T option The found element or None.
Modifiers: inline

Returns the first element for which the given function returns true. Return None if no such element exists.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T option

The found element or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryFindBack predicate

Full Usage: this.tryFindBack predicate

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

Returns: 'T option The found element or None.
Modifiers: inline

Returns the last element for which the given function returns true. Return None if no such element exists.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T option

The found element or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryFindIndex predicate

Full Usage: this.tryFindIndex predicate

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

Returns: int option The found index or None.
Modifiers: inline

Returns the index of the first element in the sequence that satisfies the given predicate. Return None if no such element exists.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: int option

The found index or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryFindIndexBack predicate

Full Usage: this.tryFindIndexBack predicate

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

Returns: int option The found index or None.
Modifiers: inline

Returns the index of the last element in the sequence that satisfies the given predicate. Return None if no such element exists.

This function digests the whole initial sequence as soon as it is called. As a result this function should not be used with large or infinite sequences.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: int option

The found index or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryHead ()

Full Usage: this.tryHead ()

Parameters:
    () : unit

Returns: 'T option The first element of the sequence or None.
Modifiers: inline

Returns the first element of the sequence, or None if the sequence is empty.

Extended Type: IEnumerable

() : unit
Returns: 'T option

The first element of the sequence or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryItem index

Full Usage: this.tryItem index

Parameters:
    index : int - The index of element to retrieve.

Returns: 'T option The nth element of the sequence or None.
Modifiers: inline

Tries to find the nth element in the sequence. Returns None if index is negative or the input sequence does not contain enough elements.

Extended Type: IEnumerable

index : int

The index of element to retrieve.

Returns: 'T option

The nth element of the sequence or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryLast ()

Full Usage: this.tryLast ()

Parameters:
    () : unit

Returns: 'T option The last element of the sequence or None.
Modifiers: inline

Returns the last element of the sequence. Return None if no such element exists.

Extended Type: IEnumerable

() : unit
Returns: 'T option

The last element of the sequence or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryPick chooser

Full Usage: this.tryPick chooser

Parameters:
    chooser : 'T -> 'U option - A function that transforms items from the input sequence into options.

Returns: 'U option The chosen element or None.
Modifiers: inline
Type parameters: 'U

Applies the given function to successive elements, returning the first result where the function returns "Some(x)".

Extended Type: IEnumerable

chooser : 'T -> 'U option

A function that transforms items from the input sequence into options.

Returns: 'U option

The chosen element or None.

ArgumentNullException Thrown when the input sequence is null.

this.updateAt (index, value)

Full Usage: this.updateAt (index, value)

Parameters:
    index : int - The index of the item to be replaced.
    value : 'T - The new value.

Returns: 'T seq The result sequence.
Modifiers: inline

Return a new sequence with the item at a given index set to the new value.

Extended Type: IEnumerable

index : int

The index of the item to be replaced.

value : 'T

The new value.

Returns: 'T seq

The result sequence.

ArgumentException Thrown when index is outside 0..source.Length - 1

this.where predicate

Full Usage: this.where predicate

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

Returns: 'T seq The result sequence.
Modifiers: inline

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. A synonym for Seq.filter.

Extended Type: IEnumerable

predicate : 'T -> bool

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

Returns: 'T seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.

this.windowed windowSize

Full Usage: this.windowed windowSize

Parameters:
    windowSize : int - The number of elements in each window.

Returns: 'T[] seq The result sequence.
Modifiers: inline

Returns a sequence that yields sliding windows containing elements drawn from the input sequence. Each window is returned as a fresh array.

Extended Type: IEnumerable

windowSize : int

The number of elements in each window.

Returns: 'T[] seq

The result sequence.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when windowSize is not positive.

this.zip source2

Full Usage: this.zip source2

Parameters:
    source2 : 'T2 seq - The second input sequence.

Returns: ('T * 'T2) seq The result sequence.
Modifiers: inline
Type parameters: 'T2

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.

Extended Type: IEnumerable

source2 : 'T2 seq

The second input sequence.

Returns: ('T * 'T2) seq

The result sequence.

ArgumentNullException Thrown when either of the input sequences is null.

this.zip3 (source2, source3)

Full Usage: this.zip3 (source2, source3)

Parameters:
    source2 : 'T2 seq - The second input sequence.
    source3 : 'T3 seq - The third input sequence.

Returns: ('T * 'T2 * 'T3) seq The result sequence.
Modifiers: inline
Type parameters: 'T2, 'T3

Combines the three sequences into a list of triples. The sequences need not have equal lengths: when one sequence is exhausted any remaining elements in the other sequences are ignored.

Extended Type: IEnumerable

source2 : 'T2 seq

The second input sequence.

source3 : 'T3 seq

The third input sequence.

Returns: ('T * 'T2 * 'T3) seq

The result sequence.

ArgumentNullException Thrown when any of the input sequences is null.

Type something to start searching.