ListExtensions Module
Fluent extension operations on lists.
Type extensions
Type extension | Description | ||||
Full Usage:
this.allPairs list2
Parameters:
'a list
-
The second input list.
Returns: ('T * 'a) list
The resulting list of pairs.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||
Full Usage:
this.append list2
Parameters:
'T list
-
The second input list.
Returns: 'T list
The resulting list.
Modifiers: inline |
|||||
Full Usage:
this.choose chooser
Parameters:
'T -> 'a option
-
The function to generate options from the elements.
Returns: 'a list
The list of results.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||
Full Usage:
this.collect mapping
Parameters:
'T -> 'a list
-
The function to create sub- lists from the input list elements.
Returns: 'a list
The concatenation of the sub- lists.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||
Full Usage:
this.concat lists
Parameters:
'T list[]
-
The input sequence of lists.
Returns: 'T list
The concatenation of the sequence of input lists.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.countBy projection
Parameters:
'T -> 'Key
-
A function transforming each item of the input list into a key to be
compared against the others.
Returns: ('Key * int) list
The result list.
Modifiers: inline Type parameters: 'Key |
Extended Type:
|
||||
Full Usage:
this.distinctBy projection
Parameters:
'T -> 'Key
-
A function transforming the list items into comparable keys.
Returns: 'T list
The result list.
Modifiers: inline Type parameters: 'Key |
Extended Type:
|
||||
Full Usage:
this.exactlyOne ()
Parameters:
unit
Returns: 'T
The only element of the list.
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 list. 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 list
An list containing the elements for which the given predicate returns true.
Modifiers: inline |
Extended Type:
|
||||
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 list 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 list 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 list into a comparable key.
Returns: ('Key * 'T list) list
The result list.
Modifiers: inline Type parameters: 'Key |
Extended Type:
|
||||
Full Usage:
this.head ()
Parameters:
unit
Returns: 'T
The first element of the list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.indexed ()
Parameters:
unit
Returns: (int * 'T) list
The result list.
Modifiers: inline |
|||||
Full Usage:
this.insertAt (index, value)
Parameters:
int
-
The index where the item should be inserted.
value : 'T
-
The value to insert.
Returns: 'T list
The result list.
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 list
The result list.
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 list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.length ()
Parameters:
unit
Returns: int
The length of the list.
Modifiers: inline |
|||||
Full Usage:
this.length
Returns: int
The length of the list.
Modifiers: inline |
|||||
Full Usage:
this.map mapping
Parameters:
'T -> 'a
-
The function to transform elements of the list.
Returns: 'a list
The list of transformed elements.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||
Full Usage:
this.mapi mapping
Parameters:
int -> 'T -> 'a
-
The function to transform elements and their indices.
Returns: 'a list
The list of transformed elements.
Modifiers: inline Type parameters: 'a |
Extended Type:
|
||||
Full Usage:
this.pairwise ()
Parameters:
unit
Returns: ('T * 'T) list
The result list.
Modifiers: inline |
|||||
Full Usage:
this.partition predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: 'T list * 'T list
A pair of lists. 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 list
The output list.
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 list
The result list.
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 list
The result list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.reverse ()
Parameters:
unit
Returns: 'T list
The reversed list.
Modifiers: inline |
|||||
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 list
The list of state values.
Modifiers: inline Type parameters: 'State |
Extended Type:
|
||||
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 list
The list 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 list
The list 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 list to a boolean value.
Returns: 'T list
The result list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.sortBy projection
Parameters:
'T -> 'Key
-
The function to transform list elements into the type that is compared.
Returns: 'T list
The sorted list.
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 the list elements into the type to be compared.
Returns: 'T list
The sorted list.
Modifiers: inline Type parameters: 'Key |
This is a stable sort, i.e. the original order of equal elements is preserved.
Extended Type:
|
||||
Full Usage:
this.sortWith comparer
Parameters:
'T -> 'T -> int
-
The function to compare pairs of list elements.
Returns: 'T list
The sorted list.
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 list is split.
Returns: 'T list * 'T list
The two split lists.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.tail ()
Parameters:
unit
Returns: 'T list
The list after removing the first element.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.take count
Parameters:
int
-
The number of items to take.
Returns: 'T list
The result list.
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 list
The result list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.toSeq ()
Parameters:
unit
Returns: 'T seq
The sequence of list elements.
Modifiers: inline |
|||||
Full Usage:
List.transpose lists
Parameters:
'T list seq
-
The input sequence of lists.
Returns: 'T list list
The transposed list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.truncate count
Parameters:
int
-
The maximum number of items to return.
Returns: 'T list
The result list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.tryExactlyOne ()
Parameters:
unit
Returns: 'T option
The only element of the list or None.
Modifiers: inline |
|||||
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 |
Extended Type:
|
||||
Full Usage:
this.tryFindBack predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: 'T option
The last element for which the predicate returns true, or None if
every element evaluates to false.
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 |
Extended Type:
|
||||
Full Usage:
this.tryFindIndexBack predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: int option
The index of the last element for which the predicate returns true, or None if
every element evaluates to false.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.tryHead ()
Parameters:
unit
Returns: 'T option
The first element of the list or None.
Modifiers: inline |
|||||
Full Usage:
this.tryItem index
Parameters:
int
-
The index to retrieve.
Returns: 'T option
The value at the given index or None .
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.tryLast ()
Parameters:
unit
Returns: 'T option
The last element of the list or None.
Modifiers: inline |
|||||
Full Usage:
this.tryPick chooser
Parameters:
'T -> 'a option
-
The function to transform the list 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 list
The result list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.where predicate
Parameters:
'T -> bool
-
The function to test the input elements.
Returns: 'T list
A list containing only the elements that satisfy the predicate.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.windowed windowSize
Parameters:
int
-
The number of elements in each window.
Returns: 'T list list
The result list.
Modifiers: inline |
Extended Type:
|
||||
Full Usage:
this.zip list2
Parameters:
'T2 list
-
The second input list.
Returns: ('T * 'T2) list
The list of tupled elements.
Modifiers: inline Type parameters: 'T2 |
Extended Type:
|
||||
Full Usage:
this.zip3 (list2, list3)
Parameters:
'T2 list
-
The second input list.
list3 : 'T3 list
-
The third input list.
Returns: ('T * 'T2 * 'T3) list
The list of tupled elements.
Modifiers: inline Type parameters: 'T2, 'T3 |
Extended Type:
|