ArrayExtensions Module
Fluent extension operations on arrays.
Type extensions
Type extension | Description | ||||||
Full Usage:
this.IsEmpty
Parameters:
unit
Returns: bool
True if the array is empty.
Modifiers: inline |
|||||||
Full Usage:
this.IsEmpty
Returns: bool
True if the array is empty.
Modifiers: inline |
|||||||
Full Usage:
this.allPairs array2
Parameters:
'a[]
-
The second input array.
Returns: ('T * 'a)[]
The resulting array of pairs.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||||
Full Usage:
this.append array2
Parameters:
'T[]
-
The second input array.
Returns: 'T[]
The resulting array.
Modifiers: inline |
|||||||
Full Usage:
this.choose chooser
Parameters:
'T -> 'a option
-
The function to generate options from the elements.
Returns: 'a[]
The array of results.
Modifiers: inline Type parameters: 'a |
|||||||
Full Usage:
this.collect mapping
Parameters:
'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 |
|||||||
Full Usage:
this.copy ()
Parameters:
unit
Returns: 'T[]
A copy of the input array.
Modifiers: inline |
|||||||
Full Usage:
this.countBy projection
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.distinctBy projection
Parameters:
'T -> 'Key
-
A function transforming the array items into comparable keys.
Returns: 'T[]
The result array.
Modifiers: inline Type parameters: 'Key |
Extended Type:
|
||||||
Full Usage:
this.exactlyOne ()
Parameters:
unit
Returns: 'T
The only element of the array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.exists predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: bool
True if any result from predicate is true.
Modifiers: inline |
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:
|
||||||
Full Usage:
this.filter predicate
Parameters:
'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 |
|||||||
Full Usage:
this.find predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: 'T
The first element for which predicate returns true.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.findIndex predicate
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.fold (state, folder)
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.foldBack (folder, state)
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.forall predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: bool
True if all of the array elements satisfy the predicate.
Modifiers: inline |
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:
|
||||||
Full Usage:
this.groupBy projection
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.head ()
Parameters:
unit
Returns: 'T
The first element of the array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.indexed ()
Parameters:
unit
Returns: (int * 'T)[]
The array of indexed elements.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.insertAt (index, value)
Parameters:
int
-
The index where the item should be inserted.
value : 'T
-
The value to insert.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.insertManyAt (index, values)
Parameters:
int
-
The index where the items should be inserted.
values : 'T seq
-
The values to insert.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.iter action
Parameters:
'T -> unit
-
The function to apply.
Modifiers: inline |
|||||||
Full Usage:
this.iteri action
Parameters:
int -> 'T -> unit
-
The function to apply to each index and element.
Modifiers: inline |
|||||||
Full Usage:
this.last ()
Parameters:
unit
Returns: 'T
The last element of the array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.length ()
Parameters:
unit
Returns: int
The length of the array.
Modifiers: inline |
|||||||
Full Usage:
this.length
Returns: int
The length of the array.
Modifiers: inline |
|||||||
Full Usage:
this.map mapping
Parameters:
'T -> 'a
-
The function to transform elements of the array.
Returns: 'a[]
The array of transformed elements.
Modifiers: inline Type parameters: 'a |
|||||||
Full Usage:
this.mapi mapping
Parameters:
int -> 'T -> 'a
-
The function to transform elements and their indices.
Returns: 'a[]
The array of transformed elements.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||||
Full Usage:
this.pairwise ()
Parameters:
unit
Returns: ('T * 'T)[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.partition predicate
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.permute indexMap
Parameters:
int -> int
-
The function that maps input indices to output indices.
Returns: 'T[]
The output array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.pick chooser
Parameters:
'T -> 'a option
-
The function to generate options from the elements.
Returns: 'a
The first result.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||||
Full Usage:
this.reduce reduction
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.reduceBack reduction
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.removeAt index
Parameters:
int
-
The index of the item to be removed.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.removeManyAt (index, count)
Parameters:
int
-
The index of the item to be removed.
count : int
-
The number of items to remove.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.reverse ()
Parameters:
unit
Returns: 'T[]
The reversed array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.scan (state, folder)
Parameters:
'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 |
|||||||
Full Usage:
this.scanBack (folder, state)
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.skip count
Parameters:
int
-
The number of elements to skip.
Returns: 'T[]
A copy of the input array, after removing the first N elements.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.skipWhile predicate
Parameters:
'T -> bool
-
A function that evaluates an element of the array to a boolean value.
Returns: 'T[]
The created sub array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.sortBy projection
Parameters:
'T -> 'Key
-
The function to transform array elements into the type that is compared.
Returns: 'T[]
The sorted array.
Modifiers: inline Type parameters: 'Key |
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:
|
||||||
Full Usage:
this.sortByDescending projection
Parameters:
'T -> 'Key
-
The function to transform array elements into the type that is compared.
Returns: 'T[]
The sorted array.
Modifiers: inline Type parameters: 'Key |
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:
|
||||||
Full Usage:
this.sortInPlaceBy projection
Parameters:
'T -> 'Key
-
The function to transform array elements into the type that is compared.
Modifiers: inline Type parameters: 'Key |
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:
|
||||||
Full Usage:
this.sortInPlaceWith comparer
Parameters:
'T -> 'T -> int
-
The function to compare pairs of array elements.
Modifiers: inline |
|||||||
Full Usage:
this.sortWith comparer
Parameters:
'T -> 'T -> int
-
The function to compare pairs of array elements.
Returns: 'T[]
The sorted array.
Modifiers: inline |
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:
|
||||||
Full Usage:
this.splitAt index
Parameters:
int
-
The index at which the array is split.
Returns: 'T[] * 'T[]
The two split arrays.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tail ()
Parameters:
unit
Returns: 'T[]
A new array containing the elements of the original except the first element.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.take count
Parameters:
int
-
The number of items to take.
Returns: 'T[]
The result array.
Modifiers: inline |
Throws
Extended Type:
|
||||||
Full Usage:
this.takeWhile predicate
Parameters:
'T -> bool
-
A function that evaluates to false when no more items should be returned.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.toList ()
Parameters:
unit
Returns: 'T list
The list of array elements.
Modifiers: inline |
|||||||
Full Usage:
this.toSeq ()
Parameters:
unit
Returns: 'T seq
The sequence of array elements.
Modifiers: inline |
|||||||
Full Usage:
[].transpose arrays
Parameters:
'T[] seq
-
The input sequence of arrays.
Returns: 'T[][]
The transposed array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.truncate count
Parameters:
int
-
The maximum number of items to return.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tryExactlyOne ()
Parameters:
unit
Returns: 'T option
The only element of the array or None.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tryFind predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: 'T option
The first element that satisfies the predicate, or None.
Modifiers: inline |
|||||||
Full Usage:
this.tryFindBack predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: 'T option
The last element that satisfies the predicate, or None.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tryFindIndex predicate
Parameters:
'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 |
|||||||
Full Usage:
this.tryFindIndexBack predicate
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.tryHead ()
Parameters:
unit
Returns: 'T option
The first element of the array or None.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tryItem index
Parameters:
int
-
The index of element to retrieve.
Returns: 'T option
The nth element of the array or None .
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tryLast ()
Parameters:
unit
Returns: 'T option
The last element of the array or None.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.tryPick chooser
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.updateAt (index, value)
Parameters:
int
-
The index of the item to be replaced.
value : 'T
-
The new value.
Returns: 'T[]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.where predicate
Parameters:
'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 |
Extended Type:
|
||||||
Full Usage:
this.windowed windowSize
Parameters:
int
-
The number of elements in each window.
Returns: 'T[][]
The result array.
Modifiers: inline |
Extended Type:
|
||||||
Full Usage:
this.zip array2
Parameters:
'a[]
-
The second input array.
Returns: ('T * 'a)[]
The array of tupled elements.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||||
Full Usage:
this.zip3 (array2, array3)
Parameters:
'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 |
Extended Type:
|