FSharpPlus


IReadOnlyDictionary Module

Additional operations on IReadOnlyDictionary<'Key, 'Value>

Functions and values

Function or value Description

IReadOnlyDictionary.add key value source

Full Usage: IReadOnlyDictionary.add key value source

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

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

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

IReadOnlyDictionary.choose chooser source

Full Usage: IReadOnlyDictionary.choose chooser source

Parameters:
    chooser : 'Key -> 'T -> 'U option - The function to be applied to the read-only dictionary values.
    source : IReadOnlyDictionary<'Key, 'T> - The input read-only dictionary.

Returns: IReadOnlyDictionary<'Key, 'U> The resulting read-only dictionary comprising the entries v where the chooser function returned Some(x).

Applies a function to each key and value in a read-only dictionary and then returns a read-only dictionary of entries v where the applied function returned Some(v). Returns an empty read-only dictionary when the input read-only dictionary is empty or when the applied chooser function returns None for all elements.

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

The function to be applied to the read-only dictionary values.

source : IReadOnlyDictionary<'Key, 'T>

The input read-only dictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The resulting read-only dictionary comprising the entries v where the chooser function returned Some(x).

IReadOnlyDictionary.chooseValues chooser source

Full Usage: IReadOnlyDictionary.chooseValues chooser source

Parameters:
    chooser : 'T -> 'U option - The function to be applied to the read-only dictionary values.
    source : IReadOnlyDictionary<'Key, 'T> - The input read-only dictionary.

Returns: IReadOnlyDictionary<'Key, 'U> The resulting read-only dictionary comprising the entries v where the chooser function returned Some(x).

Applies a function to each value in a read-only dictionary and then returns a read-only dictionary of entries v where the applied function returned Some(v). Returns an empty read-only dictionary when the input read-only dictionary is empty or when the applied chooser function returns None for all elements.

chooser : 'T -> 'U option

The function to be applied to the read-only dictionary values.

source : IReadOnlyDictionary<'Key, 'T>

The input read-only dictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The resulting read-only dictionary comprising the entries v where the chooser function returned Some(x).

IReadOnlyDictionary.containsKey key source

Full Usage: IReadOnlyDictionary.containsKey key source

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

key : 'Key

The key to find.

source : IReadOnlyDictionary<'Key, 'Value>

The input IReadOnlyDictionary.

Returns: bool

A bool indicating if the key was found.

IReadOnlyDictionary.empty

Full Usage: IReadOnlyDictionary.empty

Returns: IReadOnlyDictionary<'Key, 'U>
Returns: IReadOnlyDictionary<'Key, 'U>

IReadOnlyDictionary.fold folder state source

Full Usage: IReadOnlyDictionary.fold folder state source

Parameters:
    folder : 'State -> 'Key -> 'T -> 'State
    state : 'State
    source : IReadOnlyDictionary<'Key, 'T>

Returns: 'State

Folds over the bindings in the Dictionary

folder : 'State -> 'Key -> 'T -> 'State
state : 'State
source : IReadOnlyDictionary<'Key, 'T>
Returns: 'State

IReadOnlyDictionary.foldBack folder source state

Full Usage: IReadOnlyDictionary.foldBack folder source state

Parameters:
    folder : 'Key -> 'T -> 'State -> 'State
    source : IReadOnlyDictionary<'Key, 'T>
    state : 'State

Returns: 'State

Folds over the bindings in the Dictionary

folder : 'Key -> 'T -> 'State -> 'State
source : IReadOnlyDictionary<'Key, 'T>
state : 'State
Returns: 'State

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.iter action source

Full Usage: IReadOnlyDictionary.iter action source

Parameters:
    action : 'Key -> 'T -> unit - The action to apply.
    source : IReadOnlyDictionary<'Key, 'T> - The input IReadOnlyDictionary.

Applies the given action over each key and value in the read-only dictionary.

action : 'Key -> 'T -> unit

The action to apply.

source : IReadOnlyDictionary<'Key, 'T>

The input IReadOnlyDictionary.

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.map2 mapper source1 source2

Full Usage: IReadOnlyDictionary.map2 mapper source1 source2

Parameters:
    mapper : 'T1 -> 'T2 -> 'U - The mapping function.
    source1 : IReadOnlyDictionary<'Key, 'T1> - The first input IReadOnlyDictionary.
    source2 : 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.

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

The mapping function.

source1 : IReadOnlyDictionary<'Key, 'T1>

The first input IReadOnlyDictionary.

source2 : IReadOnlyDictionary<'Key, 'T2>

The second input IReadOnlyDictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The combined IReadOnlyDictionary.

IReadOnlyDictionary.mapValues mapper source

Full Usage: IReadOnlyDictionary.mapValues mapper source

Parameters:
    mapper : 'T -> 'U - The mapping function.
    source : 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.

mapper : 'T -> 'U

The mapping function.

source : IReadOnlyDictionary<'Key, 'T>

The input IReadOnlyDictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The mapped IReadOnlyDictionary.

IReadOnlyDictionary.mapi mapper source

Full Usage: IReadOnlyDictionary.mapi mapper source

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

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

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

mapper : 'Key -> 'T -> 'U

The mapping function.

source : IReadOnlyDictionary<'Key, 'T>

The input IReadOnlyDictionary.

Returns: IReadOnlyDictionary<'Key, 'U>

The mapped IReadOnlyDictionary.

IReadOnlyDictionary.remove key source

Full Usage: IReadOnlyDictionary.remove key source

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

Removes the given key from the read-only dictionary.

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

IReadOnlyDictionary.toResizeArray source

Full Usage: IReadOnlyDictionary.toResizeArray source

Parameters:
Returns: ResizeArray<KeyValuePair<'Key, 'T>> A ResizeArray containing the Key and Value of the original IReadOnlyDictionary.

Converts a read-only dictionary to a ResizeArray.

source : IReadOnlyDictionary<'Key, 'T>

The source IReadOnlyDictionary.

Returns: ResizeArray<KeyValuePair<'Key, 'T>>

A ResizeArray containing the Key and Value of the original IReadOnlyDictionary.

IReadOnlyDictionary.toSeq source

Full Usage: IReadOnlyDictionary.toSeq source

Parameters:
Returns: seq<KeyValuePair<'Key, 'T>> A sequence containing the Key and Value of the original IReadOnlyDictionary.

Converts a read-only dictionary to a sequence.

source : IReadOnlyDictionary<'Key, 'T>

The source IReadOnlyDictionary.

Returns: seq<KeyValuePair<'Key, 'T>>

A sequence containing the Key and Value of the original IReadOnlyDictionary.

IReadOnlyDictionary.tryGetValue key source

Full Usage: IReadOnlyDictionary.tryGetValue key source

Parameters:
    key : 'Key - The key whose value you wish to find.
    source : 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.

key : 'Key

The key whose value you wish to find.

source : 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.