Header menu logo FSharp.Core.Fluent

ArrayExtensions Module

Fluent extension operations on arrays.

Type extensions

Type extension Description

this.IsEmpty

Full Usage: this.IsEmpty

Parameters:
    () : unit

Returns: bool True if the array is empty.
Modifiers: inline

Returns true if the given array is empty, otherwise false.

Extended Type: []

() : unit
Returns: bool

True if the array is empty.

this.IsEmpty

Full Usage: this.IsEmpty

Returns: bool True if the array is empty.
Modifiers: inline

Returns true if the given array is empty, otherwise false.

Extended Type: []

Returns: bool

True if the array is empty.

this.allPairs array2

Full Usage: this.allPairs array2

Parameters:
    array2 : 'a[] - The second input array.

Returns: ('T * 'a)[] The resulting array of pairs.
Modifiers: inline
Type parameters: 'a

Returns a new array that contains all pairings of elements from the first and second arrays.

Extended Type: []

array2 : 'a[]

The second input array.

Returns: ('T * 'a)[]

The resulting array of pairs.

ArgumentException Thrown when either of the input arrays is null.

this.append array2

Full Usage: this.append array2

Parameters:
    array2 : 'T[] - The second input array.

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

Builds a new array that contains the elements of the first array followed by the elements of the second array.

Extended Type: []

array2 : 'T[]

The second input array.

Returns: 'T[]

The resulting array.

this.choose chooser

Full Usage: this.choose chooser

Parameters:
    chooser : 'T -> 'a option - The function to generate options from the elements.

Returns: 'a[] The array of results.
Modifiers: inline
Type parameters: 'a

Applies the given function to each element of the array. Returns the array comprised of the results "x" for each element where the function returns Some(x)

Extended Type: []

chooser : 'T -> 'a option

The function to generate options from the elements.

Returns: 'a[]

The array of results.

this.collect mapping

Full Usage: this.collect mapping

Parameters:
    mapping : 'T -> 'a[] - The function to create sub-arrays from the input array elements.

Returns: 'a[] The concatenation of the sub-arrays.
Modifiers: inline
Type parameters: 'a

For each element of the array, applies the given function. Concatenates all the results and return the combined array.

Extended Type: []

mapping : 'T -> 'a[]

The function to create sub-arrays from the input array elements.

Returns: 'a[]

The concatenation of the sub-arrays.

this.copy ()

Full Usage: this.copy ()

Parameters:
    () : unit

Returns: 'T[] A copy of the input array.
Modifiers: inline

Builds a new array that contains the elements of the given array.

Extended Type: []

() : unit
Returns: 'T[]

A copy of the input array.

this.countBy projection

Full Usage: this.countBy projection

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

Returns: ('Key * int)[] The result array.
Modifiers: inline
Type parameters: 'Key

Applies a key-generating function to each element of an array and returns an array yielding unique keys and their number of occurrences in the original array.

Extended Type: []

projection : 'T -> 'Key

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

Returns: ('Key * int)[]

The result array.

ArgumentNullException Thrown when the input array is null.

this.distinctBy projection

Full Usage: this.distinctBy projection

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

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

Returns an array 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 array then the later occurrences are discarded.

Extended Type: []

projection : 'T -> 'Key

A function transforming the array items into comparable keys.

Returns: 'T[]

The result array.

ArgumentNullException Thrown when the input array is null.

this.exactlyOne ()

Full Usage: this.exactlyOne ()

Parameters:
    () : unit

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

Returns the only element of the array.

Extended Type: []

() : unit
Returns: 'T

The only element of the array.

ArgumentNullException Thrown when the input array 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 - The function to test the input elements.

Returns: bool True if any result from predicate is true.
Modifiers: inline

Tests if any element of the array satisfies the given predicate.

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

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: bool

True if any result from predicate is true.

this.filter predicate

Full Usage: this.filter predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: 'T[] An array containing the elements for which the given predicate returns true.
Modifiers: inline

Returns a new collection containing only the elements of the collection for which the given predicate returns "true".

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: 'T[]

An array containing the elements for which the given predicate returns true.

this.find predicate

Full Usage: this.find predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

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

Returns the first element for which the given function returns 'true'. Raise KeyNotFoundException if no such element exists.

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: 'T

The first element for which predicate returns true.

KeyNotFoundException Thrown if predicate never returns true.

this.findIndex predicate

Full Usage: this.findIndex predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: int The index of the first element in the array that satisfies the given predicate.
Modifiers: inline

Returns the index of the first element in the array that satisfies the given predicate. Raise KeyNotFoundException if none of the elements satisy the predicate.

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: int

The index of the first element in the array that satisfies the given predicate.

KeyNotFoundException Thrown if predicate never returns true.

this.fold (state, folder)

Full Usage: this.fold (state, folder)

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

Returns: 'State The final state.
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: []

state : 'State

The initial state.

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

The function to update the state given the input elements.

Returns: 'State

The final state.

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 final state.
Modifiers: inline
Type parameters: 'State

Applies a function to each element of the array, 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: []

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

The function to update the state given the input elements.

state : 'State

The initial state.

Returns: 'State

The final state.

this.forall predicate

Full Usage: this.forall predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: bool True if all of the array elements satisfy the predicate.
Modifiers: inline

Tests if all elements of the array satisfy the given predicate.

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

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: bool

True if all of the array elements satisfy the predicate.

this.groupBy projection

Full Usage: this.groupBy projection

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

Returns: ('Key * 'T[])[] The result array.
Modifiers: inline
Type parameters: 'Key

Applies a key-generating function to each element of an array and yields an array of unique keys. Each unique key contains an array of all elements that match to this key.

Extended Type: []

projection : 'T -> 'Key

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

Returns: ('Key * 'T[])[]

The result array.

ArgumentNullException Thrown when the input array is null.

this.head ()

Full Usage: this.head ()

Parameters:
    () : unit

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

Returns the first element of the array.

Extended Type: []

() : unit
Returns: 'T

The first element of the array.

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

this.indexed ()

Full Usage: this.indexed ()

Parameters:
    () : unit

Returns: (int * 'T)[] The array of indexed elements.
Modifiers: inline

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

Extended Type: []

() : unit
Returns: (int * 'T)[]

The array of indexed elements.

ArgumentNullException Thrown when the input array 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[] The result array.
Modifiers: inline

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

Extended Type: []

index : int

The index where the item should be inserted.

value : 'T

The value to insert.

Returns: 'T[]

The result array.

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[] The result array.
Modifiers: inline

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

Extended Type: []

index : int

The index where the items should be inserted.

values : 'T seq

The values to insert.

Returns: 'T[]

The result array.

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

this.iter action

Full Usage: this.iter action

Parameters:
    action : 'T -> unit - The function to apply.

Modifiers: inline

Applies the given function to each element of the array.

Extended Type: []

action : 'T -> unit

The function to apply.

this.iteri action

Full Usage: this.iteri action

Parameters:
    action : int -> 'T -> unit - The function to apply to each index and element.

Modifiers: inline

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

Extended Type: []

action : int -> 'T -> unit

The function to apply to each index and element.

this.last ()

Full Usage: this.last ()

Parameters:
    () : unit

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

Returns the last element of the array.

Extended Type: []

() : unit
Returns: 'T

The last element of the array.

ArgumentNullException Thrown when the input array 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 array.
Modifiers: inline

Returns the length of an array. You can also use property array.Length.

Extended Type: []

() : unit
Returns: int

The length of the array.

this.length

Full Usage: this.length

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

Returns the length of an array. You can also use property array.Length.

Extended Type: []

Returns: int

The length of the array.

this.map mapping

Full Usage: this.map mapping

Parameters:
    mapping : 'T -> 'a - The function to transform elements of the array.

Returns: 'a[] The array of transformed elements.
Modifiers: inline
Type parameters: 'a

Builds a new array whose elements are the results of applying the given function to each of the elements of the array.

Extended Type: []

mapping : 'T -> 'a

The function to transform elements of the array.

Returns: 'a[]

The array of transformed elements.

this.mapi mapping

Full Usage: this.mapi mapping

Parameters:
    mapping : int -> 'T -> 'a - The function to transform elements and their indices.

Returns: 'a[] The array of transformed elements.
Modifiers: inline
Type parameters: 'a

Builds a new array whose elements are the results of applying the given function to each of the elements of the array. The integer index passed to the function indicates the index of element being transformed.

Extended Type: []

mapping : int -> 'T -> 'a

The function to transform elements and their indices.

Returns: 'a[]

The array of transformed elements.

this.pairwise ()

Full Usage: this.pairwise ()

Parameters:
    () : unit

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

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

Extended Type: []

() : unit
Returns: ('T * 'T)[]

The result array.

ArgumentNullException Thrown when the input sequence is null.

this.partition predicate

Full Usage: this.partition predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: 'T[] * 'T[] A pair of arrays. The first containing the elements the predicate evaluated to true, and the second containing those evaluated to false.
Modifiers: inline

Splits the collection into two collections, containing the elements for which the given predicate returns "true" and "false" respectively.

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: 'T[] * 'T[]

A pair of arrays. The first containing the elements the predicate evaluated to true, and the second containing those evaluated to false.

this.permute indexMap

Full Usage: this.permute indexMap

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

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

Returns an array with all elements permuted according to the specified permutation.

Extended Type: []

indexMap : int -> int

The function that maps input indices to output indices.

Returns: 'T[]

The output array.

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

this.pick chooser

Full Usage: this.pick chooser

Parameters:
    chooser : 'T -> 'a option - The function to generate options from the elements.

Returns: 'a The first result.
Modifiers: inline
Type parameters: 'a

Applies the given function to successive elements, returning the first result where function returns Some(x) for some x. If the function never returns Some(x) then KeyNotFoundException is raised.

Extended Type: []

chooser : 'T -> 'a option

The function to generate options from the elements.

Returns: 'a

The first result.

KeyNotFoundException Thrown if every result from chooser is None.

this.reduce reduction

Full Usage: this.reduce reduction

Parameters:
    reduction : 'T -> 'T -> 'T - The function to reduce a pair of elements to a single element.

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

Applies a function to each element of the array, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN then computes f (... (f i0 i1)...) iN. Raises ArgumentException if the array has size zero.

Extended Type: []

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

The function to reduce a pair of elements to a single element.

Returns: 'T

The final result of the redcutions.

ArgumentException Thrown when the input array is empty.

this.reduceBack reduction

Full Usage: this.reduceBack reduction

Parameters:
    reduction : 'T -> 'T -> 'T - The function to reduce a pair of elements to a single element.

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

Applies a function to each element of the array, 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)). Raises ArgumentException if the array has size zero.

Extended Type: []

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

The function to reduce a pair of elements to a single element.

Returns: 'T

The final result of the reductions.

ArgumentException Thrown when the input array is empty.

this.removeAt index

Full Usage: this.removeAt index

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

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

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

Extended Type: []

index : int

The index of the item to be removed.

Returns: 'T[]

The result array.

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[] The result array.
Modifiers: inline

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

Extended Type: []

index : int

The index of the item to be removed.

count : int

The number of items to remove.

Returns: 'T[]

The result array.

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

this.reverse ()

Full Usage: this.reverse ()

Parameters:
    () : unit

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

Returns a new array with the elements in reverse order.

Extended Type: []

() : unit
Returns: 'T[]

The reversed array.

ArgumentNullException Thrown when the input array is null.

this.scan (state, folder)

Full Usage: this.scan (state, folder)

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

Returns: 'State[] The array of state values.
Modifiers: inline
Type parameters: 'State

Like fold, but return the intermediary and final results.

Extended Type: []

state : 'State

The initial state.

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

The function to update the state given the input elements.

Returns: 'State[]

The array of state values.

this.scanBack (folder, state)

Full Usage: this.scanBack (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 array of state values.
Modifiers: inline
Type parameters: 'State

Like foldBack, but return both the intermediary and final results.

Extended Type: []

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

The function to update the state given the input elements.

state : 'State

The initial state.

Returns: 'State[]

The array of state values.

ArgumentNullException Thrown when the input array is null.

this.skip count

Full Usage: this.skip count

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

Returns: 'T[] A copy of the input array, after removing the first N elements.
Modifiers: inline

Builds a new array that contains the elements of the given array, excluding the first N elements.

Extended Type: []

count : int

The number of elements to skip.

Returns: 'T[]

A copy of the input array, after removing the first N elements.

ArgumentNullException Thrown when the input array is null.
ArgumentExcepion Thrown when count is negative or exceeds the number of elements in the array.

this.skipWhile predicate

Full Usage: this.skipWhile predicate

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

Returns: 'T[] The created sub array.
Modifiers: inline

Bypasses elements in an array while the given predicate returns true, and then returns the remaining elements in a new array.

Extended Type: []

predicate : 'T -> bool

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

Returns: 'T[]

The created sub array.

ArgumentNullException Thrown when the input array is null.

this.sortBy projection

Full Usage: this.sortBy projection

Parameters:
    projection : 'T -> 'Key - The function to transform array elements into the type that is compared.

Returns: 'T[] The sorted array.
Modifiers: inline
Type parameters: 'Key

Sorts the elements of an array, using the given projection for the keys and returning a new array. Elements are compared using Operators.compare.

This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

Extended Type: []

projection : 'T -> 'Key

The function to transform array elements into the type that is compared.

Returns: 'T[]

The sorted array.

this.sortByDescending projection

Full Usage: this.sortByDescending projection

Parameters:
    projection : 'T -> 'Key - The function to transform array elements into the type that is compared.

Returns: 'T[] The sorted array.
Modifiers: inline
Type parameters: 'Key

Sorts the elements of an array, in descending order, using the given projection for the keys and returning a new array. Elements are compared using Operators.compare.

This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

Extended Type: []

projection : 'T -> 'Key

The function to transform array elements into the type that is compared.

Returns: 'T[]

The sorted array.

this.sortInPlaceBy projection

Full Usage: this.sortInPlaceBy projection

Parameters:
    projection : 'T -> 'Key - The function to transform array elements into the type that is compared.

Modifiers: inline
Type parameters: 'Key

Sorts the elements of an array by mutating the array in-place, using the given projection for the keys. Elements are compared using Operators.compare.

This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

Extended Type: []

projection : 'T -> 'Key

The function to transform array elements into the type that is compared.

this.sortInPlaceWith comparer

Full Usage: this.sortInPlaceWith comparer

Parameters:
    comparer : 'T -> 'T -> int - The function to compare pairs of array elements.

Modifiers: inline

Sorts the elements of an array by mutating the array in-place, using the given comparison function as the order.

Extended Type: []

comparer : 'T -> 'T -> int

The function to compare pairs of array elements.

this.sortWith comparer

Full Usage: this.sortWith comparer

Parameters:
    comparer : 'T -> 'T -> int - The function to compare pairs of array elements.

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

Sorts the elements of an array, using the given comparison function as the order, returning a new array.

This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.

Extended Type: []

comparer : 'T -> 'T -> int

The function to compare pairs of array elements.

Returns: 'T[]

The sorted array.

ArgumentNullException Thrown when the input array is null.

this.splitAt index

Full Usage: this.splitAt index

Parameters:
    index : int - The index at which the array is split.

Returns: 'T[] * 'T[] The two split arrays.
Modifiers: inline

Splits an array into two arrays, at the given index.

Extended Type: []

index : int

The index at which the array is split.

Returns: 'T[] * 'T[]

The two split arrays.

ArgumentNullException Thrown when the input array is null.
InvalidOperationException Thrown when split index exceeds the number of elements in the array.

this.tail ()

Full Usage: this.tail ()

Parameters:
    () : unit

Returns: 'T[] A new array containing the elements of the original except the first element.
Modifiers: inline

Returns a new array containing the elements of the original except the first element.

Extended Type: []

() : unit
Returns: 'T[]

A new array containing the elements of the original except the first element.

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

this.take count

Full Usage: this.take count

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

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

Returns the first N elements of the array.

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

Extended Type: []

count : int

The number of items to take.

Returns: 'T[]

The result array.

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

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[] The result array.
Modifiers: inline

Returns an array that contains all elements of the original array while the given predicate returns true, and then returns no further elements.

Extended Type: []

predicate : 'T -> bool

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

Returns: 'T[]

The result array.

ArgumentNullException Thrown when the input array is null.

this.toList ()

Full Usage: this.toList ()

Parameters:
    () : unit

Returns: 'T list The list of array elements.
Modifiers: inline

Builds a list from the given array.

Extended Type: []

() : unit
Returns: 'T list

The list of array elements.

this.toSeq ()

Full Usage: this.toSeq ()

Parameters:
    () : unit

Returns: 'T seq The sequence of array elements.
Modifiers: inline

Views the given array as a sequence.

Extended Type: []

() : unit
Returns: 'T seq

The sequence of array elements.

[].transpose arrays

Full Usage: [].transpose arrays

Parameters:
    arrays : 'T[] seq - The input sequence of arrays.

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

Returns the transpose of the given sequence of arrays.

Extended Type: []

arrays : 'T[] seq

The input sequence of arrays.

Returns: 'T[][]

The transposed array.

ArgumentNullException Thrown when the input sequence is null.
ArgumentException Thrown when the input arrays differ in length.

this.truncate count

Full Usage: this.truncate count

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

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

Returns at most N elements in a new array.

Extended Type: []

count : int

The maximum number of items to return.

Returns: 'T[]

The result array.

ArgumentNullException Thrown when the input array is null.
ArgumentException Thrown when the count is negative.

this.tryExactlyOne ()

Full Usage: this.tryExactlyOne ()

Parameters:
    () : unit

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

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

Extended Type: []

() : unit
Returns: 'T option

The only element of the array or None.

ArgumentNullException Thrown when the input array is null.

this.tryFind predicate

Full Usage: this.tryFind predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: 'T option The first element that satisfies the predicate, or None.
Modifiers: inline

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

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: 'T option

The first element that satisfies the predicate, or None.

this.tryFindBack predicate

Full Usage: this.tryFindBack predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: 'T option The last element that satisfies the predicate, or None.
Modifiers: inline

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

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: 'T option

The last element that satisfies the predicate, or None.

ArgumentNullException Thrown when the input array is null.

this.tryFindIndex predicate

Full Usage: this.tryFindIndex predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: int option The index of the first element that satisfies the predicate, or None.
Modifiers: inline

Returns the index of the first element in the array that satisfies the given predicate.

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: int option

The index of the first element that satisfies the predicate, or None.

this.tryFindIndexBack predicate

Full Usage: this.tryFindIndexBack predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: int option The index of the last element that satisfies the predicate, or None.
Modifiers: inline

Returns the index of the last element in the array that satisfies the given predicate.

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: int option

The index of the last element that satisfies the predicate, or None.

ArgumentNullException Thrown when the input array is null.

this.tryHead ()

Full Usage: this.tryHead ()

Parameters:
    () : unit

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

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

Extended Type: []

() : unit
Returns: 'T option

The first element of the array or None.

ArgumentNullException Thrown when the input array 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 array or None.
Modifiers: inline

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

Extended Type: []

index : int

The index of element to retrieve.

Returns: 'T option

The nth element of the array or None.

ArgumentNullException Thrown when the input array is null.

this.tryLast ()

Full Usage: this.tryLast ()

Parameters:
    () : unit

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

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

Extended Type: []

() : unit
Returns: 'T option

The last element of the array or None.

ArgumentNullException Thrown when the input sequence is null.

this.tryPick chooser

Full Usage: this.tryPick chooser

Parameters:
    chooser : 'T -> 'a option - The function to transform the array elements into options.

Returns: 'a option The first transformed element that is Some(x).
Modifiers: inline
Type parameters: 'a

Applies the given function to successive elements, returning the first result where function returns Some(x) for some x. If the function never returns Some(x) then None is returned.

Extended Type: []

chooser : 'T -> 'a option

The function to transform the array elements into options.

Returns: 'a option

The first transformed element that is Some(x).

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[] The result array.
Modifiers: inline

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

Extended Type: []

index : int

The index of the item to be replaced.

value : 'T

The new value.

Returns: 'T[]

The result array.

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

this.where predicate

Full Usage: this.where predicate

Parameters:
    predicate : 'T -> bool - The function to test the input elements.

Returns: 'T[] An array containing the elements for which the given predicate returns true.
Modifiers: inline

Returns a new array containing only the elements of the array for which the given predicate returns "true".

Extended Type: []

predicate : 'T -> bool

The function to test the input elements.

Returns: 'T[]

An array containing the elements for which the given predicate returns true.

ArgumentNullException Thrown when the input array is null.

this.windowed windowSize

Full Usage: this.windowed windowSize

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

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

Returns an array of sliding windows containing elements drawn from the input array. Each window is returned as a fresh array.

Extended Type: []

windowSize : int

The number of elements in each window.

Returns: 'T[][]

The result array.

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

this.zip array2

Full Usage: this.zip array2

Parameters:
    array2 : 'a[] - The second input array.

Returns: ('T * 'a)[] The array of tupled elements.
Modifiers: inline
Type parameters: 'a

Combines the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an ArgumentException is raised.

Extended Type: []

array2 : 'a[]

The second input array.

Returns: ('T * 'a)[]

The array of tupled elements.

ArgumentException Thrown when the input arrays differ in length.

this.zip3 (array2, array3)

Full Usage: this.zip3 (array2, array3)

Parameters:
    array2 : 'a[] - The second input list.
    array3 : 'b[] - The third input list.

Returns: ('T * 'a * 'b)[] The list of tupled elements.
Modifiers: inline
Type parameters: 'a, 'b

Combines three arrays into an list of pairs. The three arrays must have equal lengths, otherwise an ArgumentException is raised.

Extended Type: []

array2 : 'a[]

The second input list.

array3 : 'b[]

The third input list.

Returns: ('T * 'a * 'b)[]

The list of tupled elements.

ArgumentException Thrown when the input arrays differ in length.

Type something to start searching.