LanguageExt.Core

LanguageExt.Core Immutable Collections HashMap

Contents

struct HashMap <K, V> Source #

Unsorted immutable hash-map

Parameters

type K

Key type

type V

Value

Indexers

this [ V ] Source #

'this' accessor

Parameters

param key

Key

returns

Optional value

Properties

property bool IsEmpty Source #

Is the map empty

property int Count Source #

Number of items in the map

property int Length Source #

Alias of Count

property IEnumerable<K> Keys Source #

Enumerable of map keys

property IEnumerable<V> Values Source #

Enumerable of map values

Constructors

constructor HashMap (IEnumerable<(K Key, V Value)> items) Source #

constructor HashMap (IEnumerable<(K Key, V Value)> items, bool tryAdd) Source #

Methods

method Lens<HashMap<K, V>, V> item (K key) Source #

Item at index lens

method Lens<HashMap<K, V>, Option<V>> itemOrNone (K key) Source #

Item or none at index lens

method Lens<HashMap<K, V>, HashMap<K, B>> map <B> (Lens<V, B> lens) Source #

Lens map

method IReadOnlyDictionary<K, V> ToReadOnlyDictionary () Source #

Get a IReadOnlyDictionary for this map. No mapping is required, so this is very fast.

method HashMap<K, V> Filter (Func<V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<K, V> Filter (Func<K, V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<K, U> Map <U> (Func<V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<K, U> Map <U> (Func<K, V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<K, V> Add (K key, V value) Source #

Atomically adds a new item to the map

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> TryAdd (K key, V value) Source #

Atomically adds a new item to the map. If the key already exists, then the new item is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> AddOrUpdate (K key, V value) Source #

Atomically adds a new item to the map. If the key already exists, the new item replaces it.

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> AddOrUpdate (K key, Func<V, V> Some, Func<V> None) Source #

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<K, V> AddOrUpdate (K key, Func<V, V> Some, V None) Source #

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<K, V> AddRange (IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> AddRange (IEnumerable<(K Key, V Value)> range) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> TryAddRange (IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> TryAddRange (IEnumerable<(K Key, V Value)> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> TryAddRange (IEnumerable<KeyValuePair<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<K, V> AddOrUpdateRange (IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> AddOrUpdateRange (IEnumerable<(K Key, V Value)> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> AddOrUpdateRange (IEnumerable<KeyValuePair<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<K, V> Remove (K key) Source #

Atomically removes an item from the map If the key doesn't exists, the request is ignored.

Parameters

param key

Key

returns

New map with the item removed

method Option<V> Find (K key) Source #

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method IEnumerable<V> FindSeq (K key) Source #

Retrieve a value from the map by key as an enumerable

Parameters

param key

Key to find

returns

Found value

method R Find <R> (K key, Func<V, R> Some, Func<R> None) Source #

Retrieve a value from the map by key and pattern match the result.

Parameters

param key

Key to find

returns

Found value

method (HashMap<K, V> Map, V Value) FindOrAdd (K key, Func<V> None) Source #

Try to find the key in the map, if it doesn't exist, add a new item by invoking the delegate provided.

Parameters

param key

Key to find

param None

Delegate to get the value

returns

Updated map and added value

method (HashMap<K, V>, V Value) FindOrAdd (K key, V value) Source #

Try to find the key in the map, if it doesn't exist, add a new item provided.

Parameters

param key

Key to find

param value

Delegate to get the value

returns

Updated map and added value

method (HashMap<K, V> Map, Option<V> Value) FindOrMaybeAdd (K key, Func<Option<V>> None) Source #

Try to find the key in the map, if it doesn't exist, add a new item by invoking the delegate provided.

Parameters

param key

Key to find

param None

Delegate to get the value

returns

Updated map and added value

method (HashMap<K, V> Map, Option<V> Value) FindOrMaybeAdd (K key, Option<V> None) Source #

Try to find the key in the map, if it doesn't exist, add a new item by invoking the delegate provided.

Parameters

param key

Key to find

param None

Delegate to get the value

returns

Updated map and added value

method HashMap<K, V> SetItem (K key, V value) Source #

Atomically updates an existing item

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> SetItem (K key, Func<V, V> Some) Source #

Retrieve a value from the map by key, map it to a new value, put it back.

Parameters

param key

Key to set

returns

New map with the mapped value

method HashMap<K, V> TrySetItem (K key, V value) Source #

Atomically updates an existing item, unless it doesn't exist, in which case it is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> TrySetItem (K key, Func<V, V> Some) Source #

Atomically sets an item by first retrieving it, applying a map, and then putting it back. Silently fails if the value doesn't exist

Parameters

param key

Key to set

param Some

delegate to map the existing value to a new one before setting

returns

New map with the item set

method bool ContainsKey (K key) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool Contains (K key, V value) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool Contains (V value) Source #

Checks for existence of a value in the map

Parameters

param value

Value to check

returns

True if an item with the value supplied is in the map

method bool Contains <EqV> (V value) Source #

where EqV : struct, Eq<V>

Checks for existence of a value in the map

Parameters

param value

Value to check

returns

True if an item with the value supplied is in the map

method bool Contains <EqV> (K key, V value) Source #

where EqV : struct, Eq<V>

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method HashMap<K, V> Clear () Source #

Clears all items from the map

Functionally equivalent to calling Map.empty as the original structure is untouched

Parameters

returns

Empty map

method HashMap<K, V> AddRange (IEnumerable<KeyValuePair<K, V>> pairs) Source #

Atomically adds a range of items to the map

Parameters

param pairs

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<K, V> SetItems (IEnumerable<KeyValuePair<K, V>> items) Source #

Atomically sets a series of items using the KeyValuePairs provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> SetItems (IEnumerable<Tuple<K, V>> items) Source #

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> SetItems (IEnumerable<(K Key, V Value)> items) Source #

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> TrySetItems (IEnumerable<KeyValuePair<K, V>> items) Source #

Atomically sets a series of items using the KeyValuePairs provided. If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> TrySetItems (IEnumerable<Tuple<K, V>> items) Source #

Atomically sets a series of items using the Tuples provided If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> TrySetItems (IEnumerable<(K Key, V Value)> items) Source #

Atomically sets a series of items using the Tuples provided If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> TrySetItems (IEnumerable<K> keys, Func<V, V> Some) Source #

Atomically sets a series of items using the keys provided to find the items and the Some delegate maps to a new value. If the items don't exist then they're silently ignored.

Parameters

param keys

Keys of items to set

param Some

Function map the existing item to a new one

returns

New map with the items set

method HashMap<K, V> RemoveRange (IEnumerable<K> keys) Source #

Atomically removes a set of keys from the map

Parameters

param keys

Keys to remove

returns

New map with the items removed

method bool Contains (KeyValuePair<K, V> pair) Source #

Returns true if a Key/Value pair exists in the map

Parameters

param pair

Pair to find

returns

True if exists, false otherwise

method IReadOnlyDictionary<K, V> ToDictionary () Source #

Convert the map to an IDictionary

Parameters

returns

method IDictionary<KR, VR> ToDictionary <KR, VR> ( Func<(K Key, V Value), KR> keySelector, Func<(K Key, V Value), VR> valueSelector) Source #

where KR : notnull

Map the map the a dictionary

method IEnumerator<(K Key, V Value)> GetEnumerator () Source #

GetEnumerator - IEnumerable interface

method Seq<(K Key, V Value)> ToSeq () Source #

method HashMap<K, V> ToTrackingHashMap () Source #

Allocation free conversion to a TrackingHashMap

method string ToString () Source #

Format the collection as [(key: value), (key: value), (key: value), ...] The elipsis is used for collections over 50 items To get a formatted string with all the items, use ToFullString or ToFullArrayString.

method string ToFullString (string separator = ", ") Source #

Format the collection as (key: value), (key: value), (key: value), ...

method string ToFullArrayString (string separator = ", ") Source #

Format the collection as [(key: value), (key: value), (key: value), ...]

method IEnumerable<(K Key, V Value)> AsEnumerable () Source #

method HashMap<K, V> Append (HashMap<K, V> rhs) Source #

method HashMap<K, V> Subtract (HashMap<K, V> rhs) Source #

method bool IsProperSubsetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a proper subset of this set

Parameters

returns

True if 'other' is a proper subset of this set

method bool IsProperSubsetOf (IEnumerable<K> other) Source #

Returns True if 'other' is a proper subset of this set

Parameters

returns

True if 'other' is a proper subset of this set

method bool IsProperSupersetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a proper superset of this set

Parameters

returns

True if 'other' is a proper superset of this set

method bool IsProperSupersetOf (IEnumerable<K> other) Source #

Returns True if 'other' is a proper superset of this set

Parameters

returns

True if 'other' is a proper superset of this set

method bool IsSubsetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSubsetOf (IEnumerable<K> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSubsetOf (HashMap<K, V> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSupersetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSupersetOf (IEnumerable<K> rhs) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method HashMap<K, V> Intersect (IEnumerable<K> rhs) Source #

Returns the elements that are in both this and other

method HashMap<K, V> Intersect (IEnumerable<(K Key, V Value)> rhs) Source #

Returns the elements that are in both this and other

method HashMap<K, V> Intersect (IEnumerable<(K Key, V Value)> rhs, WhenMatched<K, V, V, V> Merge) Source #

Returns the elements that are in both this and other

method bool Overlaps (IEnumerable<(K Key, V Value)> other) Source #

Returns True if other overlaps this set

method bool Overlaps (IEnumerable<K> other) Source #

Returns True if other overlaps this set

method HashMap<K, V> Except (IEnumerable<K> rhs) Source #

Returns this - other. Only the items in this that are not in other will be returned.

method HashMap<K, V> Except (IEnumerable<(K Key, V Value)> rhs) Source #

Returns this - other. Only the items in this that are not in other will be returned.

method HashMap<K, V> SymmetricExcept (HashMap<K, V> rhs) Source #

Only items that are in one set or the other will be returned. If an item is in both, it is dropped.

method HashMap<K, V> SymmetricExcept (IEnumerable<(K Key, V Value)> rhs) Source #

Only items that are in one set or the other will be returned. If an item is in both, it is dropped.

method HashMap<K, V> Union (IEnumerable<(K, V)> rhs) Source #

Finds the union of two sets and produces a new set with the results

Parameters

param other

Other set to union with

returns

A set which contains all items from both sets

method HashMap<K, V> Union (IEnumerable<(K, V)> other, WhenMatched<K, V, V, V> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

method HashMap<K, V> Union <W> (IEnumerable<(K, W)> other, WhenMissing<K, W, V> MapRight, WhenMatched<K, V, W, V> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

The WhenMissing function is called when there is a key in the right-hand side, but not the left-hand-side. This allows the V2 value-type to be mapped to the target V value-type.

method HashMap<K, W> Union <W> (IEnumerable<(K, W)> other, WhenMissing<K, V, W> MapLeft, WhenMatched<K, V, W, W> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

The WhenMissing function is called when there is a key in the left-hand side, but not the right-hand-side. This allows the V value-type to be mapped to the target V2 value-type.

method HashMap<K, R> Union <W, R> (IEnumerable<(K, W)> other, WhenMissing<K, V, R> MapLeft, WhenMissing<K, W, R> MapRight, WhenMatched<K, V, W, R> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

The WhenMissing MapLeft function is called when there is a key in the left-hand side, but not the right-hand-side. This allows the V value-type to be mapped to the target R value-type.

The WhenMissing MapRight function is called when there is a key in the right-hand side, but not the left-hand-side. This allows the V2 value-type to be mapped to the target R value-type.

method bool Equals (object? obj) Source #

Equality of keys and values with EqDefault<V> used for values

method bool Equals (HashMap<K, V> other) Source #

Equality of keys and values with EqDefault<V> used for values

method bool Equals <EqV> (HashMap<K, V> other) Source #

where EqV : struct, Eq<V>

Equality of keys and values with EqV used for values

method bool EqualsKeys (HashMap<K, V> other) Source #

Equality of keys only

method int GetHashCode () Source #

method HashMap<K, V> Do (Action<V> f) Source #

Impure iteration of the bound values in the structure

Parameters

returns

Returns the original unmodified structure

method HashMap<K, U> Select <U> (Func<V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<K, U> Select <U> (Func<K, V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<K, V> Where (Func<V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<K, V> Where (Func<K, V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method bool ForAll (Func<K, V, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<Tuple<K, V>, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<(K Key, V Value), bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<KeyValuePair<K, V>, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<V, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<K, V, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<Tuple<K, V>, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<(K Key, V Value), bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<KeyValuePair<K, V>, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<V, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method Unit Iter (Action<K, V> action) Source #

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<V> action) Source #

Atomically iterate through all values in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<Tuple<K, V>> action) Source #

Atomically iterate through all key/value pairs (as tuples) in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<(K Key, V Value)> action) Source #

Atomically iterate through all key/value pairs (as tuples) in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<KeyValuePair<K, V>> action) Source #

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method S Fold <S> (S state, Func<S, K, V, S> folder) Source #

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

method S Fold <S> (S state, Func<S, V, S> folder) Source #

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

Operators

operator == (HashMap<K, V> lhs, HashMap<K, V> rhs) Source #

Equality of keys and values with EqDefault<V> used for values

operator != (HashMap<K, V> lhs, HashMap<K, V> rhs) Source #

In-equality of keys and values with EqDefault<V> used for values

operator + (HashMap<K, V> lhs, HashMap<K, V> rhs) Source #

operator - (HashMap<K, V> lhs, HashMap<K, V> rhs) Source #

struct HashMap <EqK, K, V> Source #

where EqK : struct, Eq<K>

Unsorted immutable hash-map

Parameters

type K

Key type

type V

Value

Indexers

this [ V ] Source #

'this' accessor

Parameters

param key

Key

returns

Optional value

Properties

property bool IsEmpty Source #

Is the map empty

property int Count Source #

Number of items in the map

property int Length Source #

Alias of Count

property IEnumerable<K> Keys Source #

Enumerable of map keys

property IEnumerable<V> Values Source #

Enumerable of map values

Constructors

constructor HashMap (IEnumerable<(K Key, V Value)> items) Source #

constructor HashMap (IEnumerable<(K Key, V Value)> items, bool tryAdd) Source #

Methods

method IReadOnlyDictionary<K, V> ToReadOnlyDictionary () Source #

Get a IReadOnlyDictionary for this map. No mapping is required, so this is very fast.

method HashMap<EqK, K, V> Filter (Func<V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<EqK, K, V> Filter (Func<K, V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<EqK, K, U> Map <U> (Func<V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<EqK, K, U> Map <U> (Func<K, V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<EqK, K, V> Add (K key, V value) Source #

Atomically adds a new item to the map

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> TryAdd (K key, V value) Source #

Atomically adds a new item to the map. If the key already exists, then the new item is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> AddOrUpdate (K key, V value) Source #

Atomically adds a new item to the map. If the key already exists, the new item replaces it.

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> AddOrUpdate (K key, Func<V, V> Some, Func<V> None) Source #

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<EqK, K, V> AddOrUpdate (K key, Func<V, V> Some, V None) Source #

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<EqK, K, V> AddRange (IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> AddRange (IEnumerable<(K, V)> range) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> TryAddRange (IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> TryAddRange (IEnumerable<(K, V)> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> TryAddRange (IEnumerable<KeyValuePair<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<EqK, K, V> AddOrUpdateRange (IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> AddOrUpdateRange (IEnumerable<(K, V)> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> AddOrUpdateRange (IEnumerable<KeyValuePair<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<EqK, K, V> Remove (K key) Source #

Atomically removes an item from the map If the key doesn't exists, the request is ignored.

Parameters

param key

Key

returns

New map with the item removed

method Option<V> Find (K key) Source #

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method IEnumerable<V> FindSeq (K key) Source #

Retrieve a value from the map by key as an enumerable

Parameters

param key

Key to find

returns

Found value

method R Find <R> (K key, Func<V, R> Some, Func<R> None) Source #

Retrieve a value from the map by key and pattern match the result.

Parameters

param key

Key to find

returns

Found value

method (HashMap<EqK, K, V> Map, V Value) FindOrAdd (K key, Func<V> None) Source #

Try to find the key in the map, if it doesn't exist, add a new item by invoking the delegate provided.

Parameters

param key

Key to find

param None

Delegate to get the value

returns

Updated map and added value

method (HashMap<EqK, K, V>, V Value) FindOrAdd (K key, V value) Source #

Try to find the key in the map, if it doesn't exist, add a new item provided.

Parameters

param key

Key to find

param value

Delegate to get the value

returns

Updated map and added value

method (HashMap<EqK, K, V> Map, Option<V> Value) FindOrMaybeAdd (K key, Func<Option<V>> None) Source #

Try to find the key in the map, if it doesn't exist, add a new item by invoking the delegate provided.

Parameters

param key

Key to find

param None

Delegate to get the value

returns

Updated map and added value

method (HashMap<EqK, K, V> Map, Option<V> Value) FindOrMaybeAdd (K key, Option<V> None) Source #

Try to find the key in the map, if it doesn't exist, add a new item by invoking the delegate provided.

Parameters

param key

Key to find

param None

Delegate to get the value

returns

Updated map and added value

method HashMap<EqK, K, V> SetItem (K key, V value) Source #

Atomically updates an existing item

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> SetItem (K key, Func<V, V> Some) Source #

Retrieve a value from the map by key, map it to a new value, put it back.

Parameters

param key

Key to set

returns

New map with the mapped value

method HashMap<EqK, K, V> TrySetItem (K key, V value) Source #

Atomically updates an existing item, unless it doesn't exist, in which case it is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> TrySetItem (K key, Func<V, V> Some) Source #

Atomically sets an item by first retrieving it, applying a map, and then putting it back. Silently fails if the value doesn't exist

Parameters

param key

Key to set

param Some

delegate to map the existing value to a new one before setting

returns

New map with the item set

method bool ContainsKey (K key) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool Contains (K key, V value) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool Contains <EqV> (K key, V value) Source #

where EqV : struct, Eq<V>

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method HashMap<EqK, K, V> Clear () Source #

Clears all items from the map

Functionally equivalent to calling Map.empty as the original structure is untouched

Parameters

returns

Empty map

method HashMap<EqK, K, V> AddRange (IEnumerable<KeyValuePair<K, V>> pairs) Source #

Atomically adds a range of items to the map

Parameters

param pairs

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<EqK, K, V> SetItems (IEnumerable<KeyValuePair<K, V>> items) Source #

Atomically sets a series of items using the KeyValuePairs provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> SetItems (IEnumerable<Tuple<K, V>> items) Source #

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> SetItems (IEnumerable<(K, V)> items) Source #

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> TrySetItems (IEnumerable<KeyValuePair<K, V>> items) Source #

Atomically sets a series of items using the KeyValuePairs provided. If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> TrySetItems (IEnumerable<Tuple<K, V>> items) Source #

Atomically sets a series of items using the Tuples provided If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> TrySetItems (IEnumerable<(K, V)> items) Source #

Atomically sets a series of items using the Tuples provided If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> TrySetItems (IEnumerable<K> keys, Func<V, V> Some) Source #

Atomically sets a series of items using the keys provided to find the items and the Some delegate maps to a new value. If the items don't exist then they're silently ignored.

Parameters

param keys

Keys of items to set

param Some

Function map the existing item to a new one

returns

New map with the items set

method HashMap<EqK, K, V> RemoveRange (IEnumerable<K> keys) Source #

Atomically removes a set of keys from the map

Parameters

param keys

Keys to remove

returns

New map with the items removed

method bool Contains (KeyValuePair<K, V> pair) Source #

Returns true if a Key/Value pair exists in the map

Parameters

param pair

Pair to find

returns

True if exists, false otherwise

method bool Contains <EqV> (KeyValuePair<K, V> pair) Source #

where EqV : struct, Eq<V>

Returns true if a Key/Value pair exists in the map

Parameters

param pair

Pair to find

returns

True if exists, false otherwise

method IReadOnlyDictionary<K, V> ToDictionary () Source #

Convert the map to an IReadOnlyDictionary<K, V>

Parameters

returns

method IDictionary<KR, VR> ToDictionary <KR, VR> ( Func<(K Key, V Value), KR> keySelector, Func<(K Key, V Value), VR> valueSelector) Source #

where KR : notnull

Map the map the a dictionary

method IEnumerator<(K Key, V Value)> GetEnumerator () Source #

GetEnumerator - IEnumerable interface

method Seq<(K Key, V Value)> ToSeq () Source #

method HashMap<EqK, K, V> ToTrackingHashMap () Source #

Allocation free conversion to a TrackingHashMap

method string ToString () Source #

Format the collection as [(key: value), (key: value), (key: value), ...] The elipsis is used for collections over 50 items To get a formatted string with all the items, use ToFullString or ToFullArrayString.

method string ToFullString (string separator = ", ") Source #

Format the collection as (key: value), (key: value), (key: value), ...

method string ToFullArrayString (string separator = ", ") Source #

Format the collection as [(key: value), (key: value), (key: value), ...]

method IEnumerable<(K Key, V Value)> AsEnumerable () Source #

method HashMap<EqK, K, V> Append (HashMap<EqK, K, V> rhs) Source #

method HashMap<EqK, K, V> Subtract (HashMap<EqK, K, V> rhs) Source #

method bool IsProperSubsetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a proper subset of this set

Parameters

returns

True if 'other' is a proper subset of this set

method bool IsProperSubsetOf (IEnumerable<K> other) Source #

Returns True if 'other' is a proper subset of this set

Parameters

returns

True if 'other' is a proper subset of this set

method bool IsProperSupersetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a proper superset of this set

Parameters

returns

True if 'other' is a proper superset of this set

method bool IsProperSupersetOf (IEnumerable<K> other) Source #

Returns True if 'other' is a proper superset of this set

Parameters

returns

True if 'other' is a proper superset of this set

method bool IsSubsetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSubsetOf (IEnumerable<K> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSubsetOf (HashMap<EqK, K, V> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSupersetOf (IEnumerable<(K Key, V Value)> other) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool IsSupersetOf (IEnumerable<K> rhs) Source #

Returns True if 'other' is a superset of this set

Parameters

returns

True if 'other' is a superset of this set

method bool Overlaps (IEnumerable<(K Key, V Value)> other) Source #

Returns True if other overlaps this set

method bool Overlaps (IEnumerable<K> other) Source #

Returns True if other overlaps this set

method HashMap<EqK, K, V> Intersect (IEnumerable<K> rhs) Source #

Returns the elements that are in both this and other

method HashMap<EqK, K, V> Intersect (IEnumerable<(K Key, V Value)> rhs) Source #

Returns the elements that are in both this and other

method HashMap<EqK, K, V> Intersect (IEnumerable<(K Key, V Value)> rhs, WhenMatched<K, V, V, V> Merge) Source #

Returns the elements that are in both this and other

method HashMap<EqK, K, V> Except (IEnumerable<K> rhs) Source #

Returns this - other. Only the items in this that are not in other will be returned.

method HashMap<EqK, K, V> Except (IEnumerable<(K Key, V Value)> rhs) Source #

Returns this - other. Only the items in this that are not in other will be returned.

method HashMap<EqK, K, V> SymmetricExcept (HashMap<EqK, K, V> rhs) Source #

Only items that are in one set or the other will be returned. If an item is in both, it is dropped.

method HashMap<EqK, K, V> SymmetricExcept (IEnumerable<(K Key, V Value)> rhs) Source #

Only items that are in one set or the other will be returned. If an item is in both, it is dropped.

method HashMap<EqK, K, V> Union (IEnumerable<(K, V)> rhs) Source #

Finds the union of two sets and produces a new set with the results

Parameters

param other

Other set to union with

returns

A set which contains all items from both sets

method HashMap<EqK, K, V> Union (IEnumerable<(K, V)> other, WhenMatched<K, V, V, V> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

method HashMap<EqK, K, V> Union <W> ( IEnumerable<(K, W)> other, WhenMissing<K, W, V> MapRight, WhenMatched<K, V, W, V> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

The WhenMissing function is called when there is a key in the right-hand side, but not the left-hand-side. This allows the V2 value-type to be mapped to the target V value-type.

method HashMap<EqK, K, W> Union <W> ( IEnumerable<(K, W)> other, WhenMissing<K, V, W> MapLeft, WhenMatched<K, V, W, W> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

The WhenMissing function is called when there is a key in the left-hand side, but not the right-hand-side. This allows the V value-type to be mapped to the target V2 value-type.

method HashMap<EqK, K, R> Union <W, R> ( IEnumerable<(K, W)> other, WhenMissing<K, V, R> MapLeft, WhenMissing<K, W, R> MapRight, WhenMatched<K, V, W, R> Merge) Source #

Union two maps.

The WhenMatched merge function is called when keys are present in both map to allow resolving to a sensible value.

The WhenMissing MapLeft function is called when there is a key in the left-hand side, but not the right-hand-side. This allows the V value-type to be mapped to the target R value-type.

The WhenMissing MapRight function is called when there is a key in the right-hand side, but not the left-hand-side. This allows the V2 value-type to be mapped to the target R value-type.

method bool Equals (object? obj) Source #

Equality of keys

method bool Equals (HashMap<EqK, K, V> other) Source #

Equality of keys and values with EqDefault<V> used for values

method bool Equals <EqV> (HashMap<EqK, K, V> other) Source #

where EqV : struct, Eq<V>

Equality of keys and values

method bool EqualKeys (HashMap<EqK, K, V> other) Source #

Equality of keys only

method int GetHashCode () Source #

method HashMap<EqK, K, V> Do (Action<V> f) Source #

Impure iteration of the bound values in the structure

Parameters

returns

Returns the original unmodified structure

method HashMap<EqK, K, U> Select <U> (Func<V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<EqK, K, U> Select <U> (Func<K, V, U> mapper) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<EqK, K, V> Where (Func<V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<EqK, K, V> Where (Func<K, V, bool> pred) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method bool ForAll (Func<K, V, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<Tuple<K, V>, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<(K Key, V Value), bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<KeyValuePair<K, V>, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool ForAll (Func<V, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<K, V, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<Tuple<K, V>, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<(K Key, V Value), bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<KeyValuePair<K, V>, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool Exists (Func<V, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method Unit Iter (Action<K, V> action) Source #

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<V> action) Source #

Atomically iterate through all values in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<Tuple<K, V>> action) Source #

Atomically iterate through all key/value pairs (as tuples) in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<(K Key, V Value)> action) Source #

Atomically iterate through all key/value pairs (as tuples) in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit Iter (Action<KeyValuePair<K, V>> action) Source #

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method S Fold <S> (S state, Func<S, K, V, S> folder) Source #

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

method S Fold <S> (S state, Func<S, V, S> folder) Source #

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

Operators

operator == (HashMap<EqK, K, V> lhs, HashMap<EqK, K, V> rhs) Source #

Equality of keys and values with EqDefault<V> used for values

operator != (HashMap<EqK, K, V> lhs, HashMap<EqK, K, V> rhs) Source #

In-equality of keys and values with EqDefault<V> used for values

operator + (HashMap<EqK, K, V> lhs, HashMap<EqK, K, V> rhs) Source #

operator - (HashMap<EqK, K, V> lhs, HashMap<EqK, K, V> rhs) Source #

class HashMapExtensions Source #

Methods

method HashMap<K, V> ToHashMap <K, V> (this IEnumerable<(K, V)> items) Source #

Create an immutable hash-map

method HashMap<K, V> ToHashMap <K, V> (this IEnumerable<Tuple<K, V>> items) Source #

Create an immutable hash-map

method HashMap<K, V> ToHashMap <K, V> (this IEnumerable<KeyValuePair<K, V>> items) Source #

Create an immutable hash-map

method HashMap<K1, HashMap<K2, V>> ToHashMap <K1, K2, V> (this IEnumerable<(K1, K2, V)> items) Source #

Create an immutable hash-map

method HashMap<K1, HashMap<K2, V>> ToHashMap <K1, K2, V> (this IEnumerable<Tuple<K1, K2, V>> items) Source #

Create an immutable hash-map

method HashMap<K1, HashMap<K2, HashMap<K3, V>>> ToHashMap <K1, K2, K3, V> (this IEnumerable<(K1, K2, K3, V)> items) Source #

Create an immutable hash-map

method HashMap<K1, HashMap<K2, HashMap<K3, V>>> ToHashMap <K1, K2, K3, V> (this IEnumerable<Tuple<K1, K2, K3, V>> items) Source #

Create an immutable hash-map

method HashMap<K1, HashMap<K2, HashMap<K3, HashMap<K4, V>>>> ToHashMap <K1, K2, K3, K4, V> (this IEnumerable<(K1, K2, K3, K4, V)> items) Source #

Create an immutable hash-map

method HashMap<K1, HashMap<K2, HashMap<K3, HashMap<K4, V>>>> ToHashMap <K1, K2, K3, K4, V> (this IEnumerable<Tuple<K1, K2, K3, K4, V>> items) Source #

Create an immutable hash-map

method int Count <K, V> (this HashMap<K, V> self) Source #

Number of items in the map

method int Sum <K> (this HashMap<K, int> self) Source #

method Option<T> Find <A, B, T> (this HashMap<A, HashMap<B, T>> self, A outerKey, B innerKey) Source #

method Option<T> Find <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, A aKey, B bKey, C cKey) Source #

method R Find <A, B, T, R> (this HashMap<A, HashMap<B, T>> self, A outerKey, B innerKey, Func<T, R> Some, Func<R> None) Source #

method R Find <A, B, C, T, R> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, A aKey, B bKey, C cKey, Func<T, R> Some, Func<R> None) Source #

method R Find <A, B, C, D, T, R> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, A aKey, B bKey, C cKey, D dKey, Func<T, R> Some, Func<R> None) Source #

method HashMap<A, HashMap<B, T>> AddOrUpdate <A, B, T> (this HashMap<A, HashMap<B, T>> self, A outerKey, B innerKey, Func<T, T> Some, Func<T> None) Source #

method HashMap<A, HashMap<B, T>> AddOrUpdate <A, B, T> (this HashMap<A, HashMap<B, T>> self, A outerKey, B innerKey, T value) Source #

method HashMap<A, HashMap<B, HashMap<C, T>>> AddOrUpdate <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, A aKey, B bKey, C cKey, T value) Source #

method HashMap<A, HashMap<B, HashMap<C, T>>> AddOrUpdate <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, A aKey, B bKey, C cKey, Func<T, T> Some, Func<T> None) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> AddOrUpdate <A, B, C, D, T> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, A aKey, B bKey, C cKey, D dKey, T value) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> AddOrUpdate <A, B, C, D, T> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, A aKey, B bKey, C cKey, D dKey, Func<T, T> Some, Func<T> None) Source #

method HashMap<A, HashMap<B, T>> Remove <A, B, T> (this HashMap<A, HashMap<B, T>> self, A outerKey, B innerKey) Source #

method HashMap<A, HashMap<B, HashMap<C, T>>> Remove <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, A aKey, B bKey, C cKey) Source #

method HashMap<A, HashMap<B, V>> MapRemoveT <A, B, T, V> (this HashMap<A, HashMap<B, T>> self, Func<HashMap<B, T>, HashMap<B, V>> map) Source #

method HashMap<A, HashMap<B, HashMap<C, V>>> MapRemoveT <A, B, C, T, V> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, Func<HashMap<C, T>, HashMap<C, V>> map) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> MapRemoveT <A, B, C, D, T, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, Func<HashMap<D, T>, HashMap<D, V>> map) Source #

method HashMap<A, HashMap<B, V>> MapT <A, B, T, V> (this HashMap<A, HashMap<B, T>> self, Func<T, V> map) Source #

method HashMap<A, HashMap<B, HashMap<C, V>>> MapT <A, B, C, T, V> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, Func<T, V> map) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> MapT <A, B, C, D, T, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, Func<T, V> map) Source #

method HashMap<A, HashMap<B, T>> FilterT <A, B, T> (this HashMap<A, HashMap<B, T>> self, Func<T, bool> pred) Source #

method HashMap<A, HashMap<B, HashMap<C, T>>> FilterT <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, Func<T, bool> pred) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> FilterT <A, B, C, D, T> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, Func<T, bool> pred) Source #

method HashMap<A, HashMap<B, T>> FilterRemoveT <A, B, T> (this HashMap<A, HashMap<B, T>> self, Func<T, bool> pred) Source #

method HashMap<A, HashMap<B, HashMap<C, T>>> FilterRemoveT <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, Func<T, bool> pred) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> FilterRemoveT <A, B, C, D, T> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, Func<T, bool> pred) Source #

method bool Exists <A, B, T> (this HashMap<A, HashMap<B, T>> self, Func<T, bool> pred) Source #

method bool Exists <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, Func<T, bool> pred) Source #

method bool Exists <A, B, C, D, T> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, Func<T, bool> pred) Source #

method bool ForAll <A, B, T> (this HashMap<A, HashMap<B, T>> self, Func<T, bool> pred) Source #

method bool ForAll <A, B, C, T> (this HashMap<A, HashMap<B, HashMap<C, T>>> self, Func<T, bool> pred) Source #

method bool ForAll <A, B, C, D, T> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, T>>>> self, Func<T, bool> pred) Source #

method HashMap<A, HashMap<B, V>> SetItemT <A, B, V> (this HashMap<A, HashMap<B, V>> map, A aKey, B bKey, V value) Source #

method HashMap<A, HashMap<B, HashMap<C, V>>> SetItemT <A, B, C, V> (this HashMap<A, HashMap<B, HashMap<C, V>>> map, A aKey, B bKey, C cKey, V value) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> SetItemT <A, B, C, D, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> map, A aKey, B bKey, C cKey, D dKey, V value) Source #

method HashMap<A, HashMap<B, V>> SetItemT <A, B, V> (this HashMap<A, HashMap<B, V>> map, A aKey, B bKey, Func<V, V> Some) Source #

method HashMap<A, HashMap<B, HashMap<C, V>>> SetItemT <A, B, C, V> (this HashMap<A, HashMap<B, HashMap<C, V>>> map, A aKey, B bKey, C cKey, Func<V, V> Some) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> SetItemT <A, B, C, D, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> map, A aKey, B bKey, C cKey, D dKey, Func<V, V> Some) Source #

method HashMap<A, HashMap<B, V>> TrySetItemT <A, B, V> (this HashMap<A, HashMap<B, V>> map, A aKey, B bKey, V value) Source #

method HashMap<A, HashMap<B, HashMap<C, V>>> TrySetItemT <A, B, C, V> (this HashMap<A, HashMap<B, HashMap<C, V>>> map, A aKey, B bKey, C cKey, V value) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> TrySetItemT <A, B, C, D, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> map, A aKey, B bKey, C cKey, D dKey, V value) Source #

method HashMap<A, HashMap<B, V>> TrySetItemT <A, B, V> (this HashMap<A, HashMap<B, V>> map, A aKey, B bKey, Func<V, V> Some) Source #

method HashMap<A, HashMap<B, HashMap<C, V>>> TrySetItemT <A, B, C, V> (this HashMap<A, HashMap<B, HashMap<C, V>>> map, A aKey, B bKey, C cKey, Func<V, V> Some) Source #

method HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> TrySetItemT <A, B, C, D, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> map, A aKey, B bKey, C cKey, D dKey, Func<V, V> Some) Source #

method S FoldT <A, B, S, V> (this HashMap<A, HashMap<B, V>> map, S state, Func<S, V, S> folder) Source #

method S FoldT <A, B, C, S, V> (this HashMap<A, HashMap<B, HashMap<C, V>>> map, S state, Func<S, V, S> folder) Source #

method S FoldT <A, B, C, D, S, V> (this HashMap<A, HashMap<B, HashMap<C, HashMap<D, V>>>> map, S state, Func<S, V, S> folder) Source #

class HashMapEqExtensions Source #

Methods

method int Count <EqK, K, V> (this HashMap<EqK, K, V> self) Source #

where EqK : struct, Eq<K>

Number of items in the map

method int Sum <EqK, K> (this HashMap<EqK, K, int> self) Source #

where EqK : struct, Eq<K>

class HashMap Source #

Immutable hash-map module

Methods

method HashMap<K, V> clear <K, V> (HashMap<K, V> map) Source #

Clears all items from the map

Functionally equivalent to calling Map.empty as the original structure is untouched

Parameters

param map

Map to clear

returns

Empty map

method HashMap<K, V> empty <K, V> () Source #

Creates a new empty HashMap

method HashMap<K, V> create <K, V> () Source #

Creates a new empty HashMap

method HashMap<K, V> create <K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail) Source #

Creates a new Map seeded with the keyValues provided

method HashMap<K, V> create <K, V> ((K, V) head, params (K, V)[] tail) Source #

Creates a new Map seeded with the keyValues provided

method HashMap<K, V> create <K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #

Creates a new Map seeded with the keyValues provided

method HashMap<K, V> createRange <K, V> (IEnumerable<Tuple<K, V>> keyValues) Source #

Creates a new Map seeded with the keyValues provided

method HashMap<K, V> createRange <K, V> (IEnumerable<(K, V)> keyValues) Source #

Creates a new Map seeded with the keyValues provided

method HashMap<K, V> createRange <K, V> (IEnumerable<KeyValuePair<K, V>> keyValues) Source #

Creates a new Map seeded with the keyValues provided

method HashMap<K, V> add <K, V> (HashMap<K, V> map, K key, V value) Source #

Atomically adds a new item to the map

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> tryAdd <K, V> (HashMap<K, V> map, K key, V value) Source #

Atomically adds a new item to the map. If the key already exists, then the new item is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> addOrUpdate <K, V> (HashMap<K, V> map, K key, V value) Source #

Atomically adds a new item to the map. If the key already exists, the new item replaces it.

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> addOrUpdate <K, V> (HashMap<K, V> map, K key, Func<V, V> Some, Func<V> None) Source #

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<K, V> addOrUpdate <K, V> (HashMap<K, V> map, K key, Func<V, V> Some, V None) Source #

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<K, V> addRange <K, V> (HashMap<K, V> map, IEnumerable<Tuple<K, V>> keyValues) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> addRange <K, V> (HashMap<K, V> map, IEnumerable<(K, V)> keyValues) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> addRange <K, V> (HashMap<K, V> map, IEnumerable<KeyValuePair<K, V>> keyValues) Source #

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> tryAddRange <K, V> (HashMap<K, V> map, IEnumerable<Tuple<K, V>> keyValues) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> tryAddRange <K, V> (HashMap<K, V> map, IEnumerable<(K, V)> keyValues) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> tryAddRange <K, V> (HashMap<K, V> map, IEnumerable<KeyValuePair<K, V>> keyValues) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<K, V> addOrUpdateRange <K, V> (HashMap<K, V> map, IEnumerable<Tuple<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> addOrUpdateRange <K, V> (HashMap<K, V> map, IEnumerable<(K, V)> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<K, V> addOrUpdateRange <K, V> (HashMap<K, V> map, IEnumerable<KeyValuePair<K, V>> range) Source #

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<K, V> remove <K, V> (HashMap<K, V> map, K key) Source #

Atomically removes an item from the map If the key doesn't exists, the request is ignored.

Parameters

param key

Key

returns

New map with the item removed

method bool containsKey <K, V> (HashMap<K, V> map, K key) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool contains <K, V> (HashMap<K, V> map, KeyValuePair<K, V> kv) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool contains <K, V> (HashMap<K, V> map, Tuple<K, V> kv) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool contains <K, V> (HashMap<K, V> map, (K, V) kv) Source #

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method HashMap<K, V> setItem <K, V> (HashMap<K, V> map, K key, V value) Source #

Atomically updates an existing item

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> trySetItem <K, V> (HashMap<K, V> map, K key, V value) Source #

Atomically updates an existing item, unless it doesn't exist, in which case it is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<K, V> trySetItem <K, V> (HashMap<K, V> map, K key, Func<V, V> Some) Source #

Atomically sets an item by first retrieving it, applying a map (Some), and then putting it back. Silently fails if the value doesn't exist.

Parameters

param key

Key to set

param Some

delegate to map the existing value to a new one before setting

returns

New map with the item set

method HashMap<K, V> setItems <K, V> (HashMap<K, V> map, IEnumerable<Tuple<K, V>> items) Source #

Atomically sets a series of items using the Tuples provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> setItems <K, V> (HashMap<K, V> map, IEnumerable<(K, V)> items) Source #

Atomically sets a series of items using the Tuples provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> setItems <K, V> (HashMap<K, V> map, IEnumerable<KeyValuePair<K, V>> items) Source #

Atomically sets a series of items using the KeyValuePairs provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> trySetItems <K, V> (HashMap<K, V> map, IEnumerable<Tuple<K, V>> items) Source #

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> trySetItems <K, V> (HashMap<K, V> map, IEnumerable<(K, V)> items) Source #

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> trySetItems <K, V> (HashMap<K, V> map, IEnumerable<KeyValuePair<K, V>> items) Source #

Atomically sets a series of items using the KeyValuePairs provided. If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<K, V> trySetItems <K, V> (HashMap<K, V> map, IEnumerable<K> keys, Func<V, V> Some) Source #

Atomically sets a series of items using the keys provided to find the items and the Some delegate maps to a new value. If the items don't exist then they're silently ignored.

Parameters

param keys

Keys of items to set

param Some

Function map the existing item to a new one

returns

New map with the items set

method Option<V> find <K, V> (HashMap<K, V> map, K key) Source #

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method IEnumerable<V> findSeq <K, V> (HashMap<K, V> map, K key) Source #

Retrieve a value from the map by key as an enumerable

Parameters

param key

Key to find

returns

Found value

method R find <K, V, R> (HashMap<K, V> map, K key, Func<V, R> Some, Func<R> None) Source #

Retrieve a value from the map by key and pattern match the result.

Parameters

param key

Key to find

returns

Found value

method HashMap<K, V> setItem <K, V> (HashMap<K, V> map, K key, Func<V, V> mapper) Source #

Retrieve a value from the map by key, map it to a new value, put it back.

Parameters

param key

Key to find

returns

New map with the mapped value

method Unit iter <K, V> (HashMap<K, V> map, Action<V> action) Source #

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit iter <K, V> (HashMap<K, V> map, Action<K, V> action) Source #

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method bool forall <K, V> (HashMap<K, V> map, Func<V, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <K, V> (HashMap<K, V> map, Func<K, V, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <K, V> (HashMap<K, V> map, Func<Tuple<K, V>, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <K, V> (HashMap<K, V> map, Func<(K Key, V Value), bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <K, V> (HashMap<K, V> map, Func<KeyValuePair<K, V>, bool> pred) Source #

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method HashMap<K, U> map <K, T, U> (HashMap<K, T> map, Func<T, U> f) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<K, U> map <K, T, U> (HashMap<K, T> map, Func<K, T, U> f) Source #

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<K, V> filter <K, V> (HashMap<K, V> map, Func<V, bool> predicate) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<K, V> filter <K, V> (HashMap<K, V> map, Func<K, V, bool> predicate) Source #

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method int length <K, T> (HashMap<K, T> map) Source #

Number of items in the map

method S fold <S, K, V> (HashMap<K, V> map, S state, Func<S, K, V, S> folder) Source #

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

method S fold <S, K, V> (HashMap<K, V> map, S state, Func<S, V, S> folder) Source #

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

method bool exists <K, V> (HashMap<K, V> map, Func<K, V, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <K, V> (HashMap<K, V> map, Func<Tuple<K, V>, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <K, V> (HashMap<K, V> map, Func<(K Key, V Value), bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <K, V> (HashMap<K, V> map, Func<KeyValuePair<K, V>, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <K, V> (HashMap<K, V> map, Func<V, bool> pred) Source #

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

class HashMap Source #

Immutable hash-map module

Methods

method HashMap<EqK, K, V> clear <EqK, K, V> (HashMap<EqK, K, V> map) Source #

where EqK : struct, Eq<K>

Clears all items from the map

Functionally equivalent to calling Map.empty as the original structure is untouched

Parameters

param map

Map to clear

returns

Empty map

method HashMap<EqK, K, V> empty <EqK, K, V> () Source #

where EqK : struct, Eq<K>

Creates a new empty Map

method HashMap<EqK, K, V> create <EqK, K, V> () Source #

where EqK : struct, Eq<K>

Creates a new empty HashMap

method HashMap<EqK, K, V> create <EqK, K, V> (Tuple<K, V> head, params Tuple<K, V>[] tail) Source #

where EqK : struct, Eq<K>

Creates a new Map seeded with the keyValues provided

method HashMap<EqK, K, V> create <EqK, K, V> ((K, V) head, params (K, V)[] tail) Source #

where EqK : struct, Eq<K>

Creates a new Map seeded with the keyValues provided

method HashMap<EqK, K, V> create <EqK, K, V> (KeyValuePair<K, V> head, params KeyValuePair<K, V>[] tail) Source #

where EqK : struct, Eq<K>

Creates a new Map seeded with the keyValues provided

method HashMap<EqK, K, V> createRange <EqK, K, V> (IEnumerable<Tuple<K, V>> keyValues) Source #

where EqK : struct, Eq<K>

Creates a new Map seeded with the keyValues provided

method HashMap<EqK, K, V> createRange <EqK, K, V> (IEnumerable<(K, V)> keyValues) Source #

where EqK : struct, Eq<K>

Creates a new Map seeded with the keyValues provided

method HashMap<EqK, K, V> createRange <EqK, K, V> (IEnumerable<KeyValuePair<K, V>> keyValues) Source #

where EqK : struct, Eq<K>

Creates a new Map seeded with the keyValues provided

method HashMap<EqK, K, V> add <EqK, K, V> (HashMap<EqK, K, V> map, K key, V value) Source #

where EqK : struct, Eq<K>

Atomically adds a new item to the map

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> tryAdd <EqK, K, V> (HashMap<EqK, K, V> map, K key, V value) Source #

where EqK : struct, Eq<K>

Atomically adds a new item to the map. If the key already exists, then the new item is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> addOrUpdate <EqK, K, V> (HashMap<EqK, K, V> map, K key, V value) Source #

where EqK : struct, Eq<K>

Atomically adds a new item to the map. If the key already exists, the new item replaces it.

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> addOrUpdate <EqK, K, V> (HashMap<EqK, K, V> map, K key, Func<V, V> Some, Func<V> None) Source #

where EqK : struct, Eq<K>

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<EqK, K, V> addOrUpdate <EqK, K, V> (HashMap<EqK, K, V> map, K key, Func<V, V> Some, V None) Source #

where EqK : struct, Eq<K>

Retrieve a value from the map by key, map it to a new value, put it back. If it doesn't exist, add a new one based on None result.

Parameters

param key

Key to find

returns

New map with the mapped value

method HashMap<EqK, K, V> addRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<Tuple<K, V>> keyValues) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> addRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<(K, V)> keyValues) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> addRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<KeyValuePair<K, V>> keyValues) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> tryAddRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<Tuple<K, V>> keyValues) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> tryAddRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<(K, V)> keyValues) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> tryAddRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<KeyValuePair<K, V>> keyValues) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map. If any of the keys exist already then they're ignored.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<EqK, K, V> addOrUpdateRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<Tuple<K, V>> range) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> addOrUpdateRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<(K, V)> range) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Parameters

param range

Range of tuples to add

returns

New Map with the items added

method HashMap<EqK, K, V> addOrUpdateRange <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<KeyValuePair<K, V>> range) Source #

where EqK : struct, Eq<K>

Atomically adds a range of items to the map. If any of the keys exist already then they're replaced.

Null is not allowed for a Key or a Value

Parameters

param range

Range of KeyValuePairs to add

returns

New Map with the items added

method HashMap<EqK, K, V> remove <EqK, K, V> (HashMap<EqK, K, V> map, K key) Source #

where EqK : struct, Eq<K>

Atomically removes an item from the map If the key doesn't exists, the request is ignored.

Parameters

param key

Key

returns

New map with the item removed

method bool containsKey <EqK, K, V> (HashMap<EqK, K, V> map, K key) Source #

where EqK : struct, Eq<K>

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool contains <EqK, K, V> (HashMap<EqK, K, V> map, KeyValuePair<K, V> kv) Source #

where EqK : struct, Eq<K>

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool contains <EqK, K, V> (HashMap<EqK, K, V> map, Tuple<K, V> kv) Source #

where EqK : struct, Eq<K>

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method bool contains <EqK, K, V> (HashMap<EqK, K, V> map, (K, V) kv) Source #

where EqK : struct, Eq<K>

Checks for existence of a key in the map

Parameters

param key

Key to check

returns

True if an item with the key supplied is in the map

method HashMap<EqK, K, V> setItem <EqK, K, V> (HashMap<EqK, K, V> map, K key, V value) Source #

where EqK : struct, Eq<K>

Atomically updates an existing item

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> trySetItem <EqK, K, V> (HashMap<EqK, K, V> map, K key, V value) Source #

where EqK : struct, Eq<K>

Atomically updates an existing item, unless it doesn't exist, in which case it is ignored

Null is not allowed for a Key or a Value

Parameters

param key

Key

param value

Value

returns

New Map with the item added

method HashMap<EqK, K, V> trySetItem <EqK, K, V> (HashMap<EqK, K, V> map, K key, Func<V, V> Some) Source #

where EqK : struct, Eq<K>

Atomically sets an item by first retrieving it, applying a map (Some), and then putting it back. Silently fails if the value doesn't exist.

Parameters

param key

Key to set

param Some

delegate to map the existing value to a new one before setting

returns

New map with the item set

method HashMap<EqK, K, V> setItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<Tuple<K, V>> items) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the Tuples provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> setItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<(K, V)> items) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the Tuples provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> setItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<KeyValuePair<K, V>> items) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the KeyValuePairs provided

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> trySetItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<Tuple<K, V>> items) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> trySetItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<(K, V)> items) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the Tuples provided.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> trySetItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<KeyValuePair<K, V>> items) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the KeyValuePairs provided. If any of the items don't exist then they're silently ignored.

Parameters

param items

Items to set

returns

New map with the items set

method HashMap<EqK, K, V> trySetItems <EqK, K, V> (HashMap<EqK, K, V> map, IEnumerable<K> keys, Func<V, V> Some) Source #

where EqK : struct, Eq<K>

Atomically sets a series of items using the keys provided to find the items and the Some delegate maps to a new value. If the items don't exist then they're silently ignored.

Parameters

param keys

Keys of items to set

param Some

Function map the existing item to a new one

returns

New map with the items set

method Option<V> find <EqK, K, V> (HashMap<EqK, K, V> map, K key) Source #

where EqK : struct, Eq<K>

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method IEnumerable<V> findSeq <EqK, K, V> (HashMap<EqK, K, V> map, K key) Source #

where EqK : struct, Eq<K>

Retrieve a value from the map by key as an enumerable

Parameters

param key

Key to find

returns

Found value

method R find <EqK, K, V, R> (HashMap<EqK, K, V> map, K key, Func<V, R> Some, Func<R> None) Source #

where EqK : struct, Eq<K>

Retrieve a value from the map by key and pattern match the result.

Parameters

param key

Key to find

returns

Found value

method HashMap<EqK, K, V> setItem <EqK, K, V> (HashMap<EqK, K, V> map, K key, Func<V, V> mapper) Source #

where EqK : struct, Eq<K>

Retrieve a value from the map by key, map it to a new value, put it back.

Parameters

param key

Key to find

returns

New map with the mapped value

method Unit iter <EqK, K, V> (HashMap<EqK, K, V> map, Action<V> action) Source #

where EqK : struct, Eq<K>

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method Unit iter <EqK, K, V> (HashMap<EqK, K, V> map, Action<K, V> action) Source #

where EqK : struct, Eq<K>

Atomically iterate through all key/value pairs in the map (in order) and execute an action on each

Parameters

param action

Action to execute

returns

Unit

method bool forall <EqK, K, V> (HashMap<EqK, K, V> map, Func<V, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <EqK, K, V> (HashMap<EqK, K, V> map, Func<K, V, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <EqK, K, V> (HashMap<EqK, K, V> map, Func<Tuple<K, V>, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <EqK, K, V> (HashMap<EqK, K, V> map, Func<(K Key, V Value), bool> pred) Source #

where EqK : struct, Eq<K>

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool forall <EqK, K, V> (HashMap<EqK, K, V> map, Func<KeyValuePair<K, V>, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if all items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method HashMap<EqK, K, U> map <EqK, K, T, U> (HashMap<EqK, K, T> map, Func<T, U> f) Source #

where EqK : struct, Eq<K>

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<EqK, K, U> map <EqK, K, T, U> (HashMap<EqK, K, T> map, Func<K, T, U> f) Source #

where EqK : struct, Eq<K>

Atomically maps the map to a new map

Parameters

returns

Mapped items in a new map

method HashMap<EqK, K, V> filter <EqK, K, V> (HashMap<EqK, K, V> map, Func<V, bool> predicate) Source #

where EqK : struct, Eq<K>

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method HashMap<EqK, K, V> filter <EqK, K, V> (HashMap<EqK, K, V> map, Func<K, V, bool> predicate) Source #

where EqK : struct, Eq<K>

Atomically filter out items that return false when a predicate is applied

Parameters

param pred

Predicate

returns

New map with items filtered

method int length <EqK, K, T> (HashMap<EqK, K, T> map) Source #

where EqK : struct, Eq<K>

Number of items in the map

method S fold <EqK, S, K, V> (HashMap<EqK, K, V> map, S state, Func<S, K, V, S> folder) Source #

where EqK : struct, Eq<K>

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

method S fold <EqK, S, K, V> (HashMap<EqK, K, V> map, S state, Func<S, V, S> folder) Source #

where EqK : struct, Eq<K>

Atomically folds all items in the map (in order) using the folder function provided.

Parameters

type S

State type

param state

Initial state

param folder

Fold function

returns

Folded state

method bool exists <EqK, K, V> (HashMap<EqK, K, V> map, Func<K, V, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <EqK, K, V> (HashMap<EqK, K, V> map, Func<Tuple<K, V>, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <EqK, K, V> (HashMap<EqK, K, V> map, Func<(K Key, V Value), bool> pred) Source #

where EqK : struct, Eq<K>

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <EqK, K, V> (HashMap<EqK, K, V> map, Func<KeyValuePair<K, V>, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied

method bool exists <EqK, K, V> (HashMap<EqK, K, V> map, Func<V, bool> pred) Source #

where EqK : struct, Eq<K>

Return true if any items in the map return true when the predicate is applied

Parameters

param pred

Predicate

returns

True if all items in the map return true when the predicate is applied