FSharpPlus


Map Module

Additional operations on Map<'Key, 'Value>

Functions and values

Function or value Description

Map.chooseValues mapping source

Full Usage: Map.chooseValues mapping source

Parameters:
    mapping : 'T -> 'a option - The mapping function.
    source : Map<'Key, 'T> - The input Map.

Returns: Map<'Key, 'a> Returns Map with values x for each Map value where the function returns Some(x).

Applies given function to each value of the given Map.

mapping : 'T -> 'a option

The mapping function.

source : Map<'Key, 'T>

The input Map.

Returns: Map<'Key, 'a>

Returns Map with values x for each Map value where the function returns Some(x).

Map.choosei f x

Full Usage: Map.choosei f x

Parameters:
    f : 'Key -> 'T -> 'U option - The mapping function, taking key and element as parameters.
    x : Map<'Key, 'T> - The input map.

Returns: Map<'Key, 'U> Returns Map with values (k, v) for each Map value where the function returns Some(v).

Same as chooseValues but with access to the key.

f : 'Key -> 'T -> 'U option

The mapping function, taking key and element as parameters.

x : Map<'Key, 'T>

The input map.

Returns: Map<'Key, 'U>

Returns Map with values (k, v) for each Map value where the function returns Some(v).

Map.intersect source1 source2

Full Usage: Map.intersect source1 source2

Parameters:
    source1 : Map<'Key, 'T>
    source2 : Map<'Key, 'T>

Returns: Map<'Key, 'T>

Returns the intersection of two maps, preferring values from the first in case of duplicate keys.

source1 : Map<'Key, 'T>
source2 : Map<'Key, 'T>
Returns: Map<'Key, 'T>

Map.intersectWith combiner source1 source2

Full Usage: Map.intersectWith combiner source1 source2

Parameters:
    combiner : 'T -> 'T -> 'T
    source1 : Map<'Key, 'T>
    source2 : Map<'Key, 'T>

Returns: Map<'Key, 'T>

Returns the intersection of two maps, using the combiner function for duplicate keys.

combiner : 'T -> 'T -> 'T
source1 : Map<'Key, 'T>
source2 : Map<'Key, 'T>
Returns: Map<'Key, 'T>

Map.keys source

Full Usage: Map.keys source

Parameters:
    source : Map<'Key, 'T> - The input map.

Returns: 'Key seq A seq of the keys in the map.

Returns the keys of the given map.

Note: this function has since been added to FSharp.Core. It will be removed in next major release of FSharpPlus.

source : Map<'Key, 'T>

The input map.

Returns: 'Key seq

A seq of the keys in the map.

Map.mapValues f x

Full Usage: Map.mapValues f x

Parameters:
    f : 'T -> 'h - The mapping function - takes only the value, and returns the mapped value.
    x : Map<'Key, 'T> - The input Map.

Returns: Map<'Key, 'h> The mapped Map.

Maps the values of the original Map.

The core `Map.map` function maps over values too, but it passes both key and value to the mapping function.

f : 'T -> 'h

The mapping function - takes only the value, and returns the mapped value.

x : Map<'Key, 'T>

The input Map.

Returns: Map<'Key, 'h>

The mapped Map.

Map.mapValues2 f x y

Full Usage: Map.mapValues2 f x y

Parameters:
    f : 'T1 -> 'T2 -> 'b - The mapping function.
    x : Map<'Key, 'T1> - The first input Map.
    y : Map<'Key, 'T2> - The second input Map.

Returns: Map<'Key, 'b> The mapped Map.

Maps values of two Maps.

Keys that are not present on both Maps are dropped.

f : 'T1 -> 'T2 -> 'b

The mapping function.

x : Map<'Key, 'T1>

The first input Map.

y : Map<'Key, 'T2>

The second input Map.

Returns: Map<'Key, 'b>

The mapped Map.

Map.mapValues3 mapping x y z

Full Usage: Map.mapValues3 mapping x y z

Parameters:
    mapping : 'T1 -> 'T2 -> 'T3 -> 'b - The mapping function.
    x : Map<'Key, 'T1> - First input Map.
    y : Map<'Key, 'T2> - Second input Map.
    z : Map<'Key, 'T3> - Third input Map.

Returns: Map<'Key, 'b> The mapped Map.

Combines values from three maps using mapping function.

Keys that are not present on every Map are dropped.

mapping : 'T1 -> 'T2 -> 'T3 -> 'b

The mapping function.

x : Map<'Key, 'T1>

First input Map.

y : Map<'Key, 'T2>

Second input Map.

z : Map<'Key, 'T3>

Third input Map.

Returns: Map<'Key, 'b>

The mapped Map.

Map.union source altSource

Full Usage: Map.union source altSource

Parameters:
    source : Map<'Key, 'T>
    altSource : Map<'Key, 'T>

Returns: Map<'Key, 'T>

Returns the union of two maps, preferring values from the first in case of duplicate keys.

source : Map<'Key, 'T>
altSource : Map<'Key, 'T>
Returns: Map<'Key, 'T>

Map.unionWith combiner source1 source2

Full Usage: Map.unionWith combiner source1 source2

Parameters:
    combiner : 'Value -> 'Value -> 'Value
    source1 : Map<'Key, 'Value>
    source2 : Map<'Key, 'Value>

Returns: Map<'Key, 'Value>

Returns the union of two maps, using the combiner function for duplicate keys.

combiner : 'Value -> 'Value -> 'Value
source1 : Map<'Key, 'Value>
source2 : Map<'Key, 'Value>
Returns: Map<'Key, 'Value>

Map.unzip source

Full Usage: Map.unzip source

Parameters:
    source : Map<'Key, ('T1 * 'T2)> - The source Map.

Returns: Map<'Key, 'T1> * Map<'Key, 'T2> A tuple of each untupled Map.

Splits a Map with tuple pair values to two separate Maps.

source : Map<'Key, ('T1 * 'T2)>

The source Map.

Returns: Map<'Key, 'T1> * Map<'Key, 'T2>

A tuple of each untupled Map.

Map.values source

Full Usage: Map.values source

Parameters:
    source : Map<'Key, 'T> - The input map.

Returns: 'T seq A seq of the values in the map.

Returns the values of the given map.

Note: this function has since been added to FSharp.Core. It will be removed in next major release of FSharpPlus.

source : Map<'Key, 'T>

The input map.

Returns: 'T seq

A seq of the values in the map.

Map.zip x y

Full Usage: Map.zip x y

Parameters:
    x : Map<'Key, 'T1> - The first input Map.
    y : Map<'Key, 'T2> - The second input Map.

Returns: Map<'Key, ('T1 * 'T2)> The tupled Map.

Tuples values of two Maps.

Keys that are not present on both Maps are dropped.

x : Map<'Key, 'T1>

The first input Map.

y : Map<'Key, 'T2>

The second input Map.

Returns: Map<'Key, ('T1 * 'T2)>

The tupled Map.