FSharpPlus


Dict Module

Additional operations on IDictionary<'Key, 'Value>

Functions and values

Function or value Description

Dict.chooseValues chooser source

Full Usage: Dict.chooseValues chooser source

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

Returns: IDictionary<'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.

chooser : 'T -> 'U option

The mapping function.

source : IDictionary<'Key, 'T>

The input dictionary.

Returns: IDictionary<'Key, 'U>

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

Dict.choosei chooser source

Full Usage: Dict.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: IDictionary<'Key, 'U> Dictionary with values (k, x) for each dictionary value where the function returns Some(x).

Choose 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: IDictionary<'Key, 'U>

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

Dict.containsKey key source

Full Usage: Dict.containsKey key source

Parameters:
    key : 'Key - The key to find.
    source : IDictionary<'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 IDictionary.ContainsKey method

key : 'Key

The key to find.

source : IDictionary<'Key, 'Value>

The input dictionary.

Returns: bool

A bool indicating if the key was found

Dict.intersect source1 source2

Full Usage: Dict.intersect source1 source2

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

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

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

Dict.intersectWith combiner source1 source2

Full Usage: Dict.intersectWith combiner source1 source2

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

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

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

Dict.keys source

Full Usage: Dict.keys source

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

Returns the keys of the given dictionary.

source : IDictionary<'a, 'b>

The input dictionary.

Returns: seq<'a>

A seq of the keys in the dictionary.

Dict.map mapper source

Full Usage: Dict.map mapper source

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

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

Maps the given function over each value in the dictionary.

mapper : 'T -> 'U

The mapping function.

source : IDictionary<'Key, 'T>

The input dictionary.

Returns: IDictionary<'Key, 'U>

The mapped dictionary.

Dict.map2 mapper source1 source2

Full Usage: Dict.map2 mapper source1 source2

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

Returns: IDictionary<'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.

mapper : 'T1 -> 'T2 -> 'U

The mapping function.

source1 : IDictionary<'Key, 'T1>

The first input dictionary.

source2 : IDictionary<'Key, 'T2>

The second input dictionary.

Returns: IDictionary<'Key, 'U>

The combined dictionary.

Dict.toIReadOnlyDictionary source

Full Usage: Dict.toIReadOnlyDictionary source

Parameters:
Returns: IReadOnlyDictionary<'a, 'b>

Converts an IDictionary to an IReadOnlyDictionary.

source : IDictionary<'a, 'b>
Returns: IReadOnlyDictionary<'a, 'b>

Dict.tryGetValue key source

Full Usage: Dict.tryGetValue key source

Parameters:
    key : 'Key - The key whose value you wish to find.
    source : IDictionary<'Key, 'Value> - The input dictionary.

Returns: 'Value option An option wrapped value

Tries to get the value of the given key.

This is a function wrapper for the IDictionary.TryGetValue method, representing the result as an Option instead of a bool plus an out-value.

key : 'Key

The key whose value you wish to find.

source : IDictionary<'Key, 'Value>

The input dictionary.

Returns: 'Value option

An option wrapped value

Dict.union source altSource

Full Usage: Dict.union source altSource

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

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

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

Dict.unionWith combiner source1 source2

Full Usage: Dict.unionWith combiner source1 source2

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

Returns: IDictionary<'Key, 'Value>

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

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

Dict.unzip source

Full Usage: Dict.unzip source

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

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

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

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

The source dictionary.

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

A tuple of each untupled dictionary.

Dict.values source

Full Usage: Dict.values source

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

Returns the values of the given dictionary.

source : IDictionary<'a, 'b>

The input dictionary.

Returns: seq<'b>

A seq of the values in the dictionary.

Dict.zip source1 source2

Full Usage: Dict.zip source1 source2

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

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

Tuples values of two dictionaries.

Keys that are not present on both dictionaries are dropped.

source1 : IDictionary<'Key, 'T1>

The first input dictionary.

source2 : IDictionary<'Key, 'T2>

The second input dictionary.

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

The tupled dictionary.