Namespace: FSharp.Collections
Assembly: FSharp.Core.dll
Function or value | Description | ||||
|
|
||||
|
|
||||
Full Usage:
List.average list
Parameters:
^T list
-
The input list.
Returns: ^T
The resulting average.
|
Raises ArgumentException if
|
||||
Full Usage:
List.averageBy projection list
Parameters:
'T -> ^U
-
The function to transform the list elements into the type to be averaged.
list : 'T list
-
The input list.
Returns: ^U
The resulting average.
|
Raises ArgumentException if
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.compareWith comparer list1 list2
Parameters:
'T -> 'T -> int
-
A function that takes an element from each list and returns an int.
If it evaluates to a non-zero value iteration is stopped and that value is returned.
list1 : 'T list
-
The first input list.
list2 : 'T list
-
The second input list.
Returns: int
Returns the first non-zero result from the comparison function. If the first list has a
larger element, the return value is always positive. If the second list has a larger
element, the return value is always negative. When the elements are equal in the two
lists, 1 is returned if the first list is longer, 0 is returned if they are equal in
length, and -1 is returned when the second list is longer.
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.exactlyOne list
Parameters:
'T list
-
The input list.
Returns: 'T
The only element of the list.
|
|
||||
Full Usage:
List.except itemsToExclude list
Parameters:
seq<'T>
-
A sequence whose elements that also occur in the input list will cause those elements to be
removed from the result.
list : 'T list
-
A list whose elements that are not also in itemsToExclude will be returned.
Returns: 'T list
A list that contains the distinct elements of list that do not appear in itemsToExclude .
|
|
||||
|
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.
|
||||
|
The predicate is applied to matching elements in the two collections up to the lesser of the two lengths of the collections. If any application returns true then the overall result is true and no further elements are tested. Otherwise, if one collections is longer than the other then the ArgumentException exception is raised. Otherwise, false is returned.
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.fold folder state list
Parameters:
'State -> 'T -> 'State
-
The function to update the state given the input elements.
state : 'State
-
The initial state.
list : 'T list
-
The input list.
Returns: 'State
The final state value.
|
|
||||
Full Usage:
List.fold2 folder state list1 list2
Parameters:
'State -> 'T1 -> 'T2 -> 'State
-
The function to update the state given the input elements.
state : 'State
-
The initial state.
list1 : 'T1 list
-
The first input list.
list2 : 'T2 list
-
The second input list.
Returns: 'State
The final state value.
|
|
||||
Full Usage:
List.foldBack folder list state
Parameters:
'T -> 'State -> 'State
-
The function to update the state given the input elements.
list : 'T list
-
The input list.
state : 'State
-
The initial state.
Returns: 'State
The state object after the folding function is applied to each element of the list.
|
|
||||
Full Usage:
List.foldBack2 folder list1 list2 state
Parameters:
'T1 -> 'T2 -> 'State -> 'State
-
The function to update the state given the input elements.
list1 : 'T1 list
-
The first input list.
list2 : 'T2 list
-
The second input list.
state : 'State
-
The initial state.
Returns: 'State
The final state value.
|
|
||||
|
The predicate is applied to the elements of the input list. If any application returns false then the overall result is false and no further elements are tested. Otherwise, true is returned.
|
||||
|
The predicate is applied to matching elements in the two collections up to the lesser of the two lengths of the collections. If any application returns false then the overall result is false and no further elements are tested. Otherwise, if one collection is longer than the other then the ArgumentException exception is raised. Otherwise, true is returned.
|
||||
|
|
||||
Full Usage:
List.head list
Parameters:
'T list
-
The input list.
Returns: 'T
The first element of the list.
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.last list
Parameters:
'T list
-
The input list.
Returns: 'T
The last element of the list.
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.map3 mapping list1 list2 list3
Parameters:
'T1 -> 'T2 -> 'T3 -> 'U
-
The function to transform triples of elements from the input lists.
list1 : 'T1 list
-
The first input list.
list2 : 'T2 list
-
The second input list.
list3 : 'T3 list
-
The third input list.
Returns: 'U list
The list of transformed elements.
|
|
||||
Full Usage:
List.mapFold mapping state list
Parameters:
'State -> 'T -> 'Result * 'State
-
The function to transform elements from the input list and accumulate the final value.
state : 'State
-
The initial state.
list : 'T list
-
The input list.
Returns: 'Result list * 'State
The list of transformed elements, and the final accumulated value.
|
|
||||
Full Usage:
List.mapFoldBack mapping list state
Parameters:
'T -> 'State -> 'Result * 'State
-
The function to transform elements from the input list and accumulate the final value.
list : 'T list
-
The input list.
state : 'State
-
The initial state.
Returns: 'Result list * 'State
The list of transformed elements, and the final accumulated value.
|
|
||||
|
|
||||
Full Usage:
List.mapi2 mapping list1 list2
Parameters:
int -> 'T1 -> 'T2 -> 'U
-
The function to transform pairs of elements from the two lists and their index.
list1 : 'T1 list
-
The first input list.
list2 : 'T2 list
-
The second input list.
Returns: 'U list
The list of transformed elements.
|
|
||||
Full Usage:
List.max list
Parameters:
'T list
-
The input list.
Returns: 'T
The maximum element.
|
Raises ArgumentException if
|
||||
Full Usage:
List.maxBy projection list
Parameters:
'T -> 'U
-
The function to transform the list elements into the type to be compared.
list : 'T list
-
The input list.
Returns: 'T
The maximum element.
|
Raises ArgumentException if
|
||||
Full Usage:
List.min list
Parameters:
'T list
-
The input list.
Returns: 'T
The minimum value.
|
Raises ArgumentException if
|
||||
Full Usage:
List.minBy projection list
Parameters:
'T -> 'U
-
The function to transform list elements into the type to be compared.
list : 'T list
-
The input list.
Returns: 'T
The minimum value.
|
Raises ArgumentException if
|
||||
Full Usage:
List.ofArray array
Parameters:
'T[]
-
The input array.
Returns: 'T list
The list of elements from the array.
|
|
||||
|
|
||||
|
|
||||
|
|||||
|
|
||||
|
|
||||
Full Usage:
List.reduce reduction list
Parameters:
'T -> 'T -> 'T
-
The function to reduce two list elements to a single element.
list : 'T list
-
The input list.
Returns: 'T
The final reduced value.
|
Raises ArgumentException if
|
||||
Full Usage:
List.reduceBack reduction list
Parameters:
'T -> 'T -> 'T
-
A function that takes in the next-to-last element of the list and the
current accumulated result to produce the next accumulated result.
list : 'T list
-
The input list.
Returns: 'T
The final result of the reductions.
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.singleton value
Parameters:
'T
-
The input item.
Returns: 'T list
The result list of one item.
|
|
||||
|
|
||||
|
|
||||
|
This is a stable sort, i.e. the original order of equal elements is preserved.
|
||||
|
This is a stable sort, i.e. the original order of equal elements is preserved.
|
||||
|
This is a stable sort, i.e. the original order of equal elements is preserved.
|
||||
|
This is a stable sort, i.e. the original order of equal elements is preserved.
|
||||
|
This is a stable sort, i.e. the original order of equal elements is preserved.
|
||||
|
|
||||
|
|
||||
Full Usage:
List.sum list
Parameters:
^T list
-
The input list.
Returns: ^T
The resulting sum.
|
|
||||
Full Usage:
List.sumBy projection list
Parameters:
'T -> ^U
-
The function to transform the list elements into the type to be summed.
list : 'T list
-
The input list.
Returns: ^U
The resulting sum.
|
|
||||
|
|
||||
|
Throws
|
||||
|
|
||||
Full Usage:
List.toArray list
Parameters:
'T list
-
The input list.
Returns: 'T[]
The array containing the elements of the list.
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
Full Usage:
List.unfold generator state
Parameters:
'State -> ('T * 'State) option
-
A function that takes in the current state and returns an option tuple of the next
element of the list and the next state value.
state : 'State
-
The initial state value.
Returns: 'T list
The result list.
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|