Additional operations on List
Function or value | Description | ||
Full Usage:
List.apply f x
Parameters:
('a -> 'b) list
-
The list of functions.
x : 'a list
-
The list of values.
Returns: 'b list
A concatenated list of the result lists of applying each function to each value
|
Example
|
||
Full Usage:
List.choosei mapping source
Parameters:
int -> 'b -> 'c option
-
The mapping function, taking index and element as parameters.
source : 'b list
-
The input list.
Returns: 'c list
List with values x for each List value where the function returns Some(x).
|
|
||
Full Usage:
List.cons x list
Parameters:
'f
-
The element to add
list : 'f list
-
The list to add to
Returns: 'f list
A concatenated list of the result lists of applying each function to each value
|
|
||
Full Usage:
List.drop count source
Parameters:
int
-
The number of items to drop.
source : 'b list
-
The input list.
Returns: 'b list
The result list.
|
![]() ![]() ![]() ![]() ![]() ![]() Returns a list that drops N elements of the original list and then yields the remaining elements of the list. When count exceeds the number of elements in the list it returns an empty list instead of throwing an exception.
|
||
Full Usage:
List.findSliceIndex slice source
Parameters:
'b list
source : 'b list
Returns: int
The index of the slice.
|
|
||
Full Usage:
List.intercalate separator source
Parameters:
'a list
source : seq<'a list>
Returns: 'a list
|
|
||
Full Usage:
List.intersperse element source
Parameters:
'T
source : 'T list
Returns: 'T list
|
|
||
Full Usage:
List.lift2 f x1 x2
Parameters:
'd -> 'e -> 'f
x1 : 'd list
x2 : 'e list
Returns: 'f list
|
|
||
Full Usage:
List.lift3 f x1 x2 x3
Parameters:
'e -> 'f -> 'g -> 'h
-
Mapping function taking three element combination as input.
x1 : 'g list
-
First list.
x2 : 'e list
-
Second list.
x3 : 'f list
-
Third list.
Returns: 'h list
List with values returned from mapping function.
|
|
||
Full Usage:
List.map2Shortest f l1 l2
Parameters:
'd -> 'e -> 'f
l1 : 'd list
l2 : 'e list
Returns: 'f list
|
![]() ![]() ![]() ![]() ![]() ![]() Safely build a new list whose elements are the results of applying the given function to each of the elements of the two lists pairwise.
|
||
Full Usage:
List.partitionMap mapping source
Parameters:
'T -> Choice<'T1, 'T2>
source : 'T list
Returns: 'T1 list * 'T2 list
A tuple with both resulting lists.
|
![]() ![]() ![]() ![]() ![]() ![]() Creates two lists by applying the mapping function to each element in the list and classifying the transformed values depending on whether they were wrapped with Choice1Of2 or Choice2Of2.
|
||
Full Usage:
List.removeAt i lst
Parameters:
int
-
The index of the item to remove
lst : 'd list
-
The input list
Returns: 'd list
For invalid indexes, the input list. Otherwise, a new list with the item removed.
|
|
||
Full Usage:
List.replace oldValue newValue source
Parameters:
seq<'T>
newValue : 'T list
source : 'T list
Returns: 'T list
|
|
||
Full Usage:
List.setAt i x lst
Parameters:
int
-
The index of the item to update
x : 'd
-
The new value of the item
lst : 'd list
-
The input list
Returns: 'd list
A new list with the updated element
|
|
||
Full Usage:
List.singleton x
Parameters:
'c
Returns: 'c list
|
|
||
Full Usage:
List.skip i list
Parameters:
int
list : 'a list
Returns: 'a list
|
|
||
Full Usage:
List.split separators source
Parameters:
seq<'a list>
source : 'a list
Returns: seq<'a list>
|
|
||
Full Usage:
List.tails x
Parameters:
'a list
Returns: 'a list list
|
|
||
Full Usage:
List.take i list
Parameters:
int
list : seq<'a>
Returns: 'a list
|
|
||
Full Usage:
List.toIReadOnlyList source
Parameters:
'a list
-
The list source
Returns: IReadOnlyList<'a>
The list converted to a System.Collections.Generic.IReadOnlyList
|
|
||
Full Usage:
List.tryFindSliceIndex slice source
Parameters:
'b list
source : 'b list
Returns: int option
The index of the slice or None .
|
![]() ![]() ![]() ![]() ![]() ![]()
Gets the index of the first occurrence of the specified slice in the source.
Returns
|
||
Full Usage:
List.zipShortest list1 list2
Parameters:
'T1 list
-
First input list.
list2 : 'T2 list
-
Second input list.
Returns: ('T1 * 'T2) list
List with corresponding pairs of input lists.
|
![]() ![]() ![]() ![]() ![]() ![]() Zip safely two lists. If one list is shorter, excess elements are discarded from the right end of the longer list.
|