FSharpPlus


IReadOnlyDictionary Module

Additional operations on IReadOnlyDictionary<'Key, 'Value>

Functions and values

Function or value Description

IReadOnlyDictionary.add key value table

Full Usage: IReadOnlyDictionary.add key value table

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

Replaces or sets the item associated with a specified key with the specified value.

key : 'Key
value : 'Value
table : IReadOnlyDictionary<'Key, 'Value>
Returns: IReadOnlyDictionary<'Key, 'Value>

IReadOnlyDictionary.chooseValues f x

Full Usage: IReadOnlyDictionary.chooseValues f x

Parameters:
    f : 'T -> 'U option - The mapping function.
    x : IReadOnlyDictionary<'Key, 'T> - The input IReadOnlyDictionary.

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

Applies given function to each value of the given read-only dictionary.

f : 'T -> 'U option

The mapping function.

x : IReadOnlyDictionary<'Key, 'T>

The input IReadOnlyDictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

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

IReadOnlyDictionary.containsKey k dct

Full Usage: IReadOnlyDictionary.containsKey k dct

Parameters:
    k : 'Key - The key to find.
    dct : IReadOnlyDictionary<'Key, 'Value> - The input IReadOnlyDictionary.

Returns: bool A bool indicating if the key was found.

Does the read-only dictionary contain the given key?

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

k : 'Key

The key to find.

dct : IReadOnlyDictionary<'Key, 'Value>

The input IReadOnlyDictionary.

Returns: bool

A bool indicating if the key was found.

IReadOnlyDictionary.intersect source1 source2

Full Usage: IReadOnlyDictionary.intersect source1 source2

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

Returns the intersection of two read-only dictionaries, preferring values from the first in case of duplicate keys.

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

IReadOnlyDictionary.intersectWith combiner source1 source2

Full Usage: IReadOnlyDictionary.intersectWith combiner source1 source2

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

Returns the intersection of two read-only dictionaries, using the combiner function for duplicate keys.

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

IReadOnlyDictionary.keys source

Full Usage: IReadOnlyDictionary.keys source

Parameters:
Returns: seq<'Key> A seq of the keys in the IReadOnlyDictionary.

Returns the keys of the given read-only dictionary.

source : IReadOnlyDictionary<'Key, 'Value>

The input IReadOnlyDictionary.

Returns: seq<'Key>

A seq of the keys in the IReadOnlyDictionary.

IReadOnlyDictionary.map f x

Full Usage: IReadOnlyDictionary.map f x

Parameters:
    f : 'T -> 'U - The mapping function.
    x : IReadOnlyDictionary<'Key, 'T> - The input IReadOnlyDictionary.

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

Maps the given function over each value in the read-only dictionary.

f : 'T -> 'U

The mapping function.

x : IReadOnlyDictionary<'Key, 'T>

The input IReadOnlyDictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The mapped IReadOnlyDictionary.

IReadOnlyDictionary.map2 f x y

Full Usage: IReadOnlyDictionary.map2 f x y

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

Returns: IReadOnlyDictionary<'Key, 'U> The combined IReadOnlyDictionary.

Creates a read-only dictionary value from a pair of read-only dictionaries, using a function to combine them.

Keys that are not present on both read-only dictionaries are dropped.

f : 'T1 -> 'T2 -> 'U

The mapping function.

x : IReadOnlyDictionary<'Key, 'T1>

The first input IReadOnlyDictionary.

y : IReadOnlyDictionary<'Key, 'T2>

The second input IReadOnlyDictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The combined IReadOnlyDictionary.

IReadOnlyDictionary.remove key table

Full Usage: IReadOnlyDictionary.remove key table

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

Removes the given key from the read-only dictionary.

key : 'Key
table : IReadOnlyDictionary<'Key, 'Value>
Returns: IReadOnlyDictionary<'Key, 'Value>

IReadOnlyDictionary.tryGetValue k dct

Full Usage: IReadOnlyDictionary.tryGetValue k dct

Parameters:
    k : 'Key - The key whose value you wish to find.
    dct : IReadOnlyDictionary<'Key, 'Value> - The input IReadOnlyDictionary.

Returns: 'Value option An option wrapped value.

Tries to get the value of the given key.

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

k : 'Key

The key whose value you wish to find.

dct : IReadOnlyDictionary<'Key, 'Value>

The input IReadOnlyDictionary.

Returns: 'Value option

An option wrapped value.

IReadOnlyDictionary.union source altSource

Full Usage: IReadOnlyDictionary.union source altSource

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

Returns the union of two read-only dictionaries, preferring values from the first in case of duplicate keys.

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

IReadOnlyDictionary.unionWith combiner source1 source2

Full Usage: IReadOnlyDictionary.unionWith combiner source1 source2

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

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

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

IReadOnlyDictionary.unzip source

Full Usage: IReadOnlyDictionary.unzip source

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

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

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

The source IReadOnlyDictionary.

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

A tuple of each untupled IReadOnlyDictionary.

IReadOnlyDictionary.values source

Full Usage: IReadOnlyDictionary.values source

Parameters:
Returns: seq<'Value> A seq of the values in the read-only dictionary.

Returns the values of the given read-only dictionary.

source : IReadOnlyDictionary<'Key, 'Value>

The input IReadOnlyDictionary.

Returns: seq<'Value>

A seq of the values in the read-only dictionary.

IReadOnlyDictionary.zip x y

Full Usage: IReadOnlyDictionary.zip x y

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

Tuples values of two read-only dictionaries.

Keys that are not present on both read-only dictionaries are dropped.

x : IReadOnlyDictionary<'Key, 'T1>

The first input IReadOnlyDictionary.

y : IReadOnlyDictionary<'Key, 'T2>

The second input IReadOnlyDictionary.

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

The tupled IReadOnlyDictionary.