Contains operations for working with values of type Map.
Function or value | Description | ||
|
![]() ![]() ![]() ![]() ![]() ![]() Returns a new map with the binding added to the given map. If a binding with the given key already exists in the input map, the existing binding is replaced by the new binding in the result map.
Example
|
||
|
Example
|
||
|
Example
|
||
|
Example
|
||
Example
|
|||
|
Example
|
||
|
Example
|
||
Full Usage:
Map.find key table
Parameters:
'Key
-
The input key.
table : Map<'Key, 'T>
-
The input map.
Returns: 'T
The value mapped to the given key.
|
Example
|
||
|
![]() ![]() ![]() ![]() ![]() ![]()
Evaluates the function on each mapping in the collection. Returns the key for the first mapping
where the function returns 'true'. Raise
Example
|
||
Full Usage:
Map.fold folder state table
Parameters:
'State -> 'Key -> 'T -> 'State
-
The function to update the state given the input key/value pairs.
state : 'State
-
The initial state.
table : Map<'Key, 'T>
-
The input map.
Returns: 'State
The final state value.
|
Example
Evaluates to "initial 1 a 2 b" .
|
||
Full Usage:
Map.foldBack folder table state
Parameters:
'Key -> 'T -> 'State -> 'State
-
The function to update the state given the input key/value pairs.
table : Map<'Key, 'T>
-
The input map.
state : 'State
-
The initial state.
Returns: 'State
The final state value.
|
Example
Evaluates to "1 a 2 b initial"
|
||
|
Example
|
||
|
Example
|
||
|
Example
Prints "1 a 2 b " .
|
||
|
Example
|
||
|
![]() ![]() ![]() ![]() ![]() ![]() Builds a new collection whose elements are the results of applying the given function to each of the elements of the collection. The key passed to the function indicates the key of element being transformed.
Example
|
||
Full Usage:
Map.maxKeyValue table
Parameters:
Map<'Key, 'T>
-
The input map.
Returns: 'Key * 'T
|
Example
|
||
Full Usage:
Map.minKeyValue table
Parameters:
Map<'Key, 'T>
-
The input map.
Returns: 'Key * 'T
|
Example
|
||
Full Usage:
Map.ofArray elements
Parameters:
('Key * 'T)[]
-
The input array of key/value pairs.
Returns: Map<'Key, 'T>
The resulting map.
|
Example
|
||
|
Example
|
||
|
Example
|
||
Full Usage:
Map.partition predicate table
Parameters:
'Key -> 'T -> bool
-
The function to test the input elements.
table : Map<'Key, 'T>
-
The input map.
Returns: Map<'Key, 'T> * Map<'Key, 'T>
A pair of maps in which the first contains the elements for which the predicate returned true
and the second containing the elements for which the predicated returned false.
|
![]() ![]() ![]() ![]() ![]() ![]() Builds two new maps, one containing the bindings for which the given predicate returns 'true', and the other the remaining bindings.
Example
|
||
|
![]() ![]() ![]() ![]() ![]() ![]()
Searches the map looking for the first element where the given function returns a
Example
Evaluates to "ccc"
Example
Raises KeyNotFoundException
|
||
|
![]() ![]() ![]() ![]() ![]() ![]() Removes an element from the domain of the map. No exception is raised if the element is not present.
Example
|
||
Full Usage:
Map.toArray table
Parameters:
Map<'Key, 'T>
-
The input map.
Returns: ('Key * 'T)[]
The array of key/value pairs.
|
![]() ![]() ![]() ![]() ![]() ![]() Returns an array of all key-value pairs in the mapping. The array will be ordered by the keys of the map.
Example
|
||
|
![]() ![]() ![]() ![]() ![]() ![]() Returns a list of all key-value pairs in the mapping. The list will be ordered by the keys of the map.
Example
|
||
|
![]() ![]() ![]() ![]() ![]() ![]() Views the collection as an enumerable sequence of pairs. The sequence will be ordered by the keys of the map.
Example
|
||
|
![]() ![]() ![]() ![]() ![]() ![]()
Lookup an element in the map, returning a
Example
|
||
Full Usage:
Map.tryFindKey predicate table
Parameters:
'Key -> 'T -> bool
-
The function to test the input elements.
table : Map<'Key, 'T>
-
The input map.
Returns: 'Key option
The first key for which the predicate returns true or None if the predicate evaluates to false for each key/value pair.
|
![]() ![]() ![]() ![]() ![]() ![]() Returns the key of the first mapping in the collection that satisfies the given predicate. Returns 'None' if no such element exists.
Example
|
||
|
Example
Evaluates to Some "ccc" .
Example
Evaluates to None .
|
||
|
![]() ![]() ![]() ![]() ![]() ![]() The values in the map, including the duplicates. The sequence will be ordered by the keys of the map.
Example
|