FSharpPlus


Dictionary Module

Additional operations on Dictionary<'Key, 'Value>

Functions and values

Function or value Description

Dictionary.chooseValues mapper source

Full Usage: Dictionary.chooseValues mapper source

Parameters:
    mapper : 'T -> 'U option - The mapping function.
    source : IDictionary<'Key, 'T> - The input dictionary.

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

Applies given function to each value of the given dictionary.

mapper : 'T -> 'U option

The mapping function.

source : IDictionary<'Key, 'T>

The input dictionary.

Returns: Dictionary<'Key, 'U>

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

Dictionary.choosei chooser source

Full Usage: Dictionary.choosei chooser source

Parameters:
    chooser : 'Key -> 'T -> 'U option - The mapping function, taking key and element as parameters.
    source : IDictionary<'Key, 'T> - The input dictionary.

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

Same as chooseValues but with access to the key.

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

The mapping function, taking key and element as parameters.

source : IDictionary<'Key, 'T>

The input dictionary.

Returns: Dictionary<'Key, 'U>

Dictionary with values (k, x) for each dictionary value where the function returns Some(x).

Dictionary.containsKey key source

Full Usage: Dictionary.containsKey key source

Parameters:
    key : 'Key - The key to find.
    source : Dictionary<'Key, 'Value> - The input dictionary.

Returns: bool A bool indicating if the key was found

Does the dictionary contain the given key?

Note: this is a function wrapper for the Dictionary.ContainsKey method.

key : 'Key

The key to find.

source : Dictionary<'Key, 'Value>

The input dictionary.

Returns: bool

A bool indicating if the key was found

Dictionary.intersect source1 source2

Full Usage: Dictionary.intersect source1 source2

Parameters:
Returns: Dictionary<'Key, 'T>

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

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

Dictionary.intersectWith combiner source1 source2

Full Usage: Dictionary.intersectWith combiner source1 source2

Parameters:
Returns: Dictionary<'Key, 'T>

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

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

Dictionary.keys source

Full Usage: Dictionary.keys source

Parameters:
    source : Dictionary<'a, 'b> - The input dictionary.

Returns: 'a seq A seq of the keys in the dictionary.

Returns the keys of the given dictionary.

source : Dictionary<'a, 'b>

The input dictionary.

Returns: 'a seq

A seq of the keys in the dictionary.

Dictionary.map mapping source

Full Usage: Dictionary.map mapping source

Parameters:
    mapping : 'T -> 'U - The mapping function.
    source : Dictionary<'Key, 'T> - The input dictionary.

Returns: Dictionary<'Key, 'U> The mapped dictionary.

Maps the given function over each value in the dictionary.

mapping : 'T -> 'U

The mapping function.

source : Dictionary<'Key, 'T>

The input dictionary.

Returns: Dictionary<'Key, 'U>

The mapped dictionary.

Dictionary.map2 mapping source1 source2

Full Usage: Dictionary.map2 mapping source1 source2

Parameters:
    mapping : 'T1 -> 'T2 -> 'U - The mapping function.
    source1 : Dictionary<'Key, 'T1> - The first input dictionary.
    source2 : Dictionary<'Key, 'T2> - The second input dictionary.

Returns: Dictionary<'Key, 'U> The combined dictionary.

Creates a Dictionary value from a pair of Dictionaries, using a function to combine them.

Keys that are not present on both dictionaries are dropped.

mapping : 'T1 -> 'T2 -> 'U

The mapping function.

source1 : Dictionary<'Key, 'T1>

The first input dictionary.

source2 : Dictionary<'Key, 'T2>

The second input dictionary.

Returns: Dictionary<'Key, 'U>

The combined dictionary.

Dictionary.map3 mapping source1 source2 source3

Full Usage: Dictionary.map3 mapping source1 source2 source3

Parameters:
    mapping : 'T1 -> 'T2 -> 'T3 -> 'U - The mapping function.
    source1 : Dictionary<'Key, 'T1> - First input Dictionary.
    source2 : Dictionary<'Key, 'T2> - Second input Dictionary.
    source3 : Dictionary<'Key, 'T3> - Third input Dictionary.

Returns: Dictionary<'Key, 'U> The mapped Dictionary.

Combines values from three Dictionaries using mapping function.

Keys that are not present on every Dictionary are dropped.

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

The mapping function.

source1 : Dictionary<'Key, 'T1>

First input Dictionary.

source2 : Dictionary<'Key, 'T2>

Second input Dictionary.

source3 : Dictionary<'Key, 'T3>

Third input Dictionary.

Returns: Dictionary<'Key, 'U>

The mapped Dictionary.

Dictionary.toIReadOnlyDictionary source

Full Usage: Dictionary.toIReadOnlyDictionary source

Parameters:
Returns: IReadOnlyDictionary<'Key, 'Value>

Converts a Dictionary to an IReadOnlyDictionary

source : Dictionary<'Key, 'Value>
Returns: IReadOnlyDictionary<'Key, 'Value>

Dictionary.tryGetValue key source

Full Usage: Dictionary.tryGetValue key source

Parameters:
    key : 'Key - The key to find.
    source : Dictionary<'Key, 'Value> - The input dictionary.

Returns: 'Value option An option wrapped value

Tries to get the value of the given key.

Note: this is a function wrapper for the Dictionary.TryGetValue method, which also represents the result as an Option instead of a bool and an out-value.

key : 'Key

The key to find.

source : Dictionary<'Key, 'Value>

The input dictionary.

Returns: 'Value option

An option wrapped value

Dictionary.union source altSource

Full Usage: Dictionary.union source altSource

Parameters:
Returns: Dictionary<'Key, 'T>

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

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

Dictionary.unionWith combiner source1 source2

Full Usage: Dictionary.unionWith combiner source1 source2

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

Returns: Dictionary<'Key, 'Value>

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

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

Dictionary.unzip source

Full Usage: Dictionary.unzip source

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

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

Splits a dictionary with tuple pair values to two separate dictionaries.

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

The source dictionary.

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

A tuple of each untupled dictionary.

Dictionary.values source

Full Usage: Dictionary.values source

Parameters:
    source : Dictionary<'a, 'b> - The input dictionary.

Returns: 'b seq A seq of the values in the dictionary.

Returns the values of the given dictionary.

source : Dictionary<'a, 'b>

The input dictionary.

Returns: 'b seq

A seq of the values in the dictionary.

Dictionary.zip source1 source2

Full Usage: Dictionary.zip source1 source2

Parameters:
    source1 : Dictionary<'Key, 'T1> - The first input dictionary.
    source2 : Dictionary<'Key, 'T2> - The second input dictionary.

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

Tuples values of two dictionaries.

Keys that are not present on both dictionaries are dropped.

source1 : Dictionary<'Key, 'T1>

The first input dictionary.

source2 : Dictionary<'Key, 'T2>

The second input dictionary.

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

The tupled dictionary.