Header menu logo FSharp.Core.Fluent

ArrayExtensionsConstrained Type

Static members

Static member Description

ArrayExtensionsConstrained.allPairs (array, array2)

Full Usage: ArrayExtensionsConstrained.allPairs (array, array2)

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

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

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

array : 'T[]
array2 : 'U[]

The second input array.

Returns: ('T * 'U)[]

The resulting array of pairs.

ArgumentException Thrown when either of the input arrays is null.

ArrayExtensionsConstrained.average array

Full Usage: ArrayExtensionsConstrained.average array

Parameters:
    array : ^T[] - The input array.

Returns: ^T The average of the elements in the array.
Modifiers: inline
Type parameters: ^T

Returns the average of the elements in the array.

array : ^T[]

The input array.

Returns: ^T

The average of the elements in the array.

ArgumentException Thrown when array is empty.

ArrayExtensionsConstrained.averageBy (array, projection)

Full Usage: ArrayExtensionsConstrained.averageBy (array, projection)

Parameters:
    array : 'T[] - The input array.
    projection : 'T -> ^U - The function to transform the array elements before averaging.

Returns: ^U The computed average.
Modifiers: inline
Type parameters: 'T, ^U

Returns the average of the elements generated by applying the function to each element of the array.

array : 'T[]

The input array.

projection : 'T -> ^U

The function to transform the array elements before averaging.

Returns: ^U

The computed average.

ArgumentException Thrown when array is empty.

ArrayExtensionsConstrained.contains (array, value)

Full Usage: ArrayExtensionsConstrained.contains (array, value)

Parameters:
    array : 'T[] - The input array.
    value : 'T - The value to locate in the input array.

Returns: bool True if the input array contains the specified element; false otherwise.
Modifiers: inline
Type parameters: 'T

Tests if the array contains the specified element.

array : 'T[]

The input array.

value : 'T

The value to locate in the input array.

Returns: bool

True if the input array contains the specified element; false otherwise.

ArgumentNullException Thrown when the input array is null.

ArrayExtensionsConstrained.distinct array

Full Usage: ArrayExtensionsConstrained.distinct array

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

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

Returns an array that contains no duplicate entries according to generic hash and equality comparisons on the entries. If an element occurs multiple times in the array then the later occurrences are discarded.

array : 'T[]

The input array.

Returns: 'T[]

The result array.

ArgumentNullException Thrown when the input array is null.

ArrayExtensionsConstrained.insertAt (array, index, value)

Full Usage: ArrayExtensionsConstrained.insertAt (array, index, value)

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

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

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

array : 'T[]
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.

ArrayExtensionsConstrained.insertManyAt (array, index, values)

Full Usage: ArrayExtensionsConstrained.insertManyAt (array, index, values)

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

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

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

array : 'T[]
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.

ArrayExtensionsConstrained.max array

Full Usage: ArrayExtensionsConstrained.max array

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

Returns: 'T The maximum element.
Modifiers: inline
Type parameters: 'T

Returns the greatest of all elements of the array, compared via Operators.max on the function result.

Throws ArgumentException for empty arrays.

array : 'T[]

The input array.

Returns: 'T

The maximum element.

ArgumentException Thrown when the input array is empty.

ArrayExtensionsConstrained.maxBy (array, projection)

Full Usage: ArrayExtensionsConstrained.maxBy (array, projection)

Parameters:
    array : 'T[] - The input array.
    projection : 'T -> 'a - The function to transform the elements into a type supporting comparison.

Returns: 'T The maximum element.
Modifiers: inline
Type parameters: 'T, 'a

Returns the greatest of all elements of the array, compared via Operators.max on the function result.

Throws ArgumentException for empty arrays.

array : 'T[]

The input array.

projection : 'T -> 'a

The function to transform the elements into a type supporting comparison.

Returns: 'T

The maximum element.

ArgumentException Thrown when the input array is empty.

ArrayExtensionsConstrained.min array

Full Usage: ArrayExtensionsConstrained.min array

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

Returns: 'T The minimum element.
Modifiers: inline
Type parameters: 'T

Returns the lowest of all elements of the array, compared via Operators.min.

Throws ArgumentException for empty arrays

array : 'T[]

The input array.

Returns: 'T

The minimum element.

ArgumentException Thrown when the input array is empty.

ArrayExtensionsConstrained.minBy (array, projection)

Full Usage: ArrayExtensionsConstrained.minBy (array, projection)

Parameters:
    array : 'T[] - The input array.
    projection : 'T -> 'a - The function to transform the elements into a type supporting comparison.

Returns: 'T The minimum element.
Modifiers: inline
Type parameters: 'T, 'a

Returns the lowest of all elements of the array, compared via Operators.min on the function result.

Throws ArgumentException for empty arrays.

array : 'T[]

The input array.

projection : 'T -> 'a

The function to transform the elements into a type supporting comparison.

Returns: 'T

The minimum element.

ArgumentException Thrown when the input array is empty.

ArrayExtensionsConstrained.removeAt (array, index)

Full Usage: ArrayExtensionsConstrained.removeAt (array, index)

Parameters:
    array : 'T[]
    index : int - The index of the item to be removed.

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

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

array : 'T[]
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

ArrayExtensionsConstrained.removeManyAt (array, index, count)

Full Usage: ArrayExtensionsConstrained.removeManyAt (array, index, count)

Parameters:
    array : 'T[]
    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
Type parameters: 'T

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

array : 'T[]
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

ArrayExtensionsConstrained.sort array

Full Usage: ArrayExtensionsConstrained.sort array

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

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

Sorts the elements of an array, 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.

array : 'T[]

The input array.

Returns: 'T[]

The sorted array.

ArrayExtensionsConstrained.sortDescending array

Full Usage: ArrayExtensionsConstrained.sortDescending array

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

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

Sorts the elements of an array, in descending order, 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.

array : 'T[]

The input array.

Returns: 'T[]

The sorted array.

ArrayExtensionsConstrained.sortInPlace array

Full Usage: ArrayExtensionsConstrained.sortInPlace array

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

Modifiers: inline
Type parameters: 'a

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

array : 'a[]

The input array.

ArrayExtensionsConstrained.splitAt (array, index)

Full Usage: ArrayExtensionsConstrained.splitAt (array, index)

Parameters:
    array : 'T[]
    index : int - The index at which the array is split.

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

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

array : 'T[]
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.

ArrayExtensionsConstrained.sum array

Full Usage: ArrayExtensionsConstrained.sum array

Parameters:
    array : ^T[] - The input array.

Returns: ^T The resulting sum.
Modifiers: inline
Type parameters: ^T

Returns the sum of the elements in the array.

array : ^T[]

The input array.

Returns: ^T

The resulting sum.

ArrayExtensionsConstrained.sumBy (array, projection)

Full Usage: ArrayExtensionsConstrained.sumBy (array, projection)

Parameters:
    array : 'T[] - The input array.
    projection : 'T -> ^U - The function to transform the array elements into the type to be summed.

Returns: ^U The resulting sum.
Modifiers: inline
Type parameters: 'T, ^U

Returns the sum of the results generated by applying the function to each element of the array.

array : 'T[]

The input array.

projection : 'T -> ^U

The function to transform the array elements into the type to be summed.

Returns: ^U

The resulting sum.

ArrayExtensionsConstrained.tryExactlyOne array

Full Usage: ArrayExtensionsConstrained.tryExactlyOne array

Parameters:
    array : 'T[]

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

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

array : 'T[]
Returns: 'T option

The only element of the array or None.

ArgumentNullException Thrown when the input array is null.

ArrayExtensionsConstrained.unzip array

Full Usage: ArrayExtensionsConstrained.unzip array

Parameters:
    array : ('a * 'b)[] - The input array.

Returns: 'a[] * 'b[] The two arrays.
Modifiers: inline
Type parameters: 'a, 'b

Splits an array of pairs into two arrays.

array : ('a * 'b)[]

The input array.

Returns: 'a[] * 'b[]

The two arrays.

ArrayExtensionsConstrained.unzip3 array

Full Usage: ArrayExtensionsConstrained.unzip3 array

Parameters:
    array : ('a * 'b * 'c)[] - The input array.

Returns: 'a[] * 'b[] * 'c[] The tuple of three arrays.
Modifiers: inline
Type parameters: 'a, 'b, 'c

Splits an array of triples into three arrays.

array : ('a * 'b * 'c)[]

The input array.

Returns: 'a[] * 'b[] * 'c[]

The tuple of three arrays.

ArrayExtensionsConstrained.updateAt (array, index, value)

Full Usage: ArrayExtensionsConstrained.updateAt (array, index, value)

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

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

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

array : 'T[]
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

Type something to start searching.