LanguageExt.Core

LanguageExt.Core Concurrency VersionHashMap

Contents

class VersionHashMap <ConflictV, K, V> Source #

where ConflictV : struct, Conflict<V>

Versioned hash-map. Each value has a vector-clock attached to it which understands the causality of updates from multiple actors. Actors are just unique keys that represent individual contributors. They could be client connections, nodes in a network, users, or whatever is appropriate to discriminate between commits.

Deleted items are not removed from the hash-map, they are merely marked as deleted. This allows conflicts between writes and deletes to be resolved.

Run RemoveDeletedItemsOlderThan to clean up items that have been deleted and are now just hanging around. Use a big enough delay that it won't conflict with other commits (this could be seconds, minutes, or longer: depending on the expected latency of writes to the hash-map).

Indexers

this [ Version<string, K, V> ] Source #

'this' accessor

Parameters

param key

Key

returns

Version - this may be in a state of never existing, but won't ever fail

Properties

property VersionHashMap<ConflictV, K, V> Empty Source #

Empty version map

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 keys

property IEnumerable<V> Values Source #

Enumerable of value

Methods

method Unit SwapKey (K key, Func<Version<string, K, V>, Version<string, K, V>> swap) Source #

Atomically swap a key in the map. Allows for multiple operations on the hash-map in an entirely transactional and atomic way.

Any functions passed as arguments may be run multiple times if there are multiple threads competing to update this data structure. Therefore the functions must spend as little time performing the injected behaviours as possible to avoid repeated attempts

Parameters

param swap

Swap function, maps the current state of the value associated with the key to a new state

method Unit Update (Version<string, K, V> version) Source #

Atomically updates a new item in the map. If the key already exists, then the vector clocks, within the version vector, are compared to ascertain if the proposed version was caused-by, causes, or conflicts with the current version:

* If the proposed version was caused-by the current version, then it is ignored.
* If the proposed version causes the current version, then it is accepted and updated as the latest version
* If the proposed version is in conflict with the current version, then values from both versions are
  passed to ConflictV.Append(v1, v2) for value resolution, and the pairwise-maximum of the two vector-clocks
  is taken to be the new 'time.

Parameters

param version

Version to update

method Unit RemoveOlderThan (DateTime cutoff) Source #

Remove items that are older than the specified time-stamp

Parameters

param cutoff

Cut off time-stamp

method Unit RemoveOlderThan (long timeStamp) Source #

Remove items that are older than the specified time-stamp

Parameters

param timeStamp

Cut off time-stamp

method Unit RemoveDeletedItemsOlderThan (DateTime cutoff) Source #

Remove deleted items that are older than the specified time-stamp

Parameters

param cutoff

Cut off time-stamp

method Unit RemoveDeletedItemsOlderThan (long timeStamp) Source #

Remove deleted items that are older than the specified time-stamp

Parameters

param timeStamp

Cut off time-stamp

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

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method Version<string, K, V> FindVersion (K value) Source #

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

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

Convert to a HashMap

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

GetEnumerator - IEnumerable interface

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

method string ToString () Source #

Format the collection as [(key: value), (key: value), (key: value), ...] The ellipsis 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 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 Unit Intersect (IEnumerable<K> rhs) 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 Unit Except (IEnumerable<K> rhs) Source #

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

method bool Equals (object? obj) Source #

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

method bool Equals (VersionHashMap<ConflictV, K, V>? other) Source #

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

method int GetHashCode () Source #

method VersionHashMap<ConflictV, K, V> Where (Func<long, Option<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 VersionHashMap<ConflictV, K, V> Where (Func<K, long, Option<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 VersionHashMap<ConflictV, K, V> Filter (Func<long, Option<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 VersionHashMap<ConflictV, K, V> Filter (Func<K, long, Option<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 Unit FilterInPlace (Func<long, Option<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 Unit FilterInPlace (Func<K, long, Option<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<(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<(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<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<(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

class VersionHashMap <ConflictV, OrdActor, EqK, Actor, K, V> Source #

where OrdActor : struct, Ord<Actor>
where EqK : struct, Eq<K>
where ConflictV : struct, Conflict<V>

Versioned hash-map. Each value has a vector-clock attached to it which understands the causality of updates from multiple actors. Actors are just unique keys that represent individual contributors. They could be client connections, nodes in a network, users, or whatever is appropriate to discriminate between commits.

Deleted items are not removed from the hash-map, they are merely marked as deleted. This allows conflicts between writes and deletes to be resolved.

Run RemoveDeletedItemsOlderThan to clean up items that have been deleted and are now just hanging around. Use a big enough delay that it won't conflict with other commits (this could be seconds, minutes, or longer: depending on the expected latency of writes to the hash-map).

Indexers

this [ Version<Actor, K, V> ] Source #

'this' accessor

Parameters

param key

Key

returns

Version - this may be in a state of never existing, but won't ever fail

Properties

property VersionHashMap<ConflictV, OrdActor, EqK, Actor, K, V> Empty Source #

Empty version map

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 keys

property IEnumerable<V> Values Source #

Enumerable of value

Methods

method Unit SwapKey (K key, Func<Version<Actor, K, V>, Version<Actor, K, V>> swap) Source #

Atomically swap a key in the map. Allows for multiple operations on the hash-map in an entirely transactional and atomic way.

Any functions passed as arguments may be run multiple times if there are multiple threads competing to update this data structure. Therefore the functions must spend as little time performing the injected behaviours as possible to avoid repeated attempts

Parameters

param swap

Swap function, maps the current state of the value associated with the key to a new state

method Unit Update (Version<Actor, K, V> nversion) Source #

Atomically updates a new item in the map. If the key already exists, then the vector clocks, within the version vector, are compared to ascertain if the proposed version was caused-by, causes, or conflicts with the current version:

* If the proposed version was caused-by the current version, then it is ignored.
* If the proposed version causes the current version, then it is accepted and updated as the latest version
* If the proposed version is in conflict with the current version, then values from both versions are
  passed to ConflictV.Append(v1, v2) for value resolution, and the pairwise-maximum of the two vector-clocks
  is taken to be the new 'time.

Parameters

param version

Version to update

method Unit RemoveOlderThan (DateTime cutoff) Source #

Remove items that are older than the specified time-stamp

Parameters

param cutoff

Cut off time-stamp

method Unit RemoveOlderThan (long timeStamp) Source #

Remove items that are older than the specified time-stamp

Parameters

param timeStamp

Cut off time-stamp

method Unit RemoveDeletedItemsOlderThan (DateTime cutoff) Source #

Remove deleted items that are older than the specified time-stamp

Parameters

param cutoff

Cut off time-stamp

method Unit RemoveDeletedItemsOlderThan (long timeStamp) Source #

Remove deleted items that are older than the specified time-stamp

Parameters

param timeStamp

Cut off time-stamp

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

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method Version<Actor, K, V> FindVersion (K key) Source #

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

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

Convert to a HashMap

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

GetEnumerator - IEnumerable interface

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

method string ToString () Source #

Format the collection as [(key: value), (key: value), (key: value), ...] The ellipsis 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 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 Unit Intersect (IEnumerable<K> rhs) 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 Unit Except (IEnumerable<K> rhs) Source #

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

method bool Equals (object? obj) Source #

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

method bool Equals (VersionHashMap<ConflictV, OrdActor, EqK, Actor, K, V>? other) Source #

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

method int GetHashCode () Source #

method VersionHashMap<ConflictV, OrdActor, EqK, Actor, K, V> Where (Func<long, Option<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 VersionHashMap<ConflictV, OrdActor, EqK, Actor, K, V> Where (Func<K, long, Option<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 VersionHashMap<ConflictV, OrdActor, EqK, Actor, K, V> Filter (Func<long, Option<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 VersionHashMap<ConflictV, OrdActor, EqK, Actor, K, V> Filter (Func<K, long, Option<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 Unit FilterInPlace (Func<long, Option<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 Unit FilterInPlace (Func<K, long, Option<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<(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<(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<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<(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

class VersionHashMap <K, V> Source #

Versioned hash-map. Each value has a vector-clock attached to it which understands the causality of updates from multiple actors. Actors are just unique keys that represent individual contributors. They could be client connections, nodes in a network, users, or whatever is appropriate to discriminate between commits.

Deleted items are not removed from the hash-map, they are merely marked as deleted. This allows conflicts between writes and deletes to be resolved.

Run RemoveDeletedItemsOlderThan to clean up items that have been deleted and are now just hanging around. Use a big enough delay that it won't conflict with other commits (this could be seconds, minutes, or longer: depending on the expected latency of writes to the hash-map).

Indexers

this [ Version<string, K, V> ] Source #

'this' accessor

Parameters

param key

Key

returns

Version - this may be in a state of never existing, but won't ever fail

Properties

property VersionHashMap<K, V> Empty Source #

Empty version map

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 keys

property IEnumerable<V> Values Source #

Enumerable of value

Methods

method Unit SwapKey (K key, Func<Version<string, K, V>, Version<string, K, V>> swap) Source #

Atomically swap a key in the map. Allows for multiple operations on the hash-map in an entirely transactional and atomic way.

Any functions passed as arguments may be run multiple times if there are multiple threads competing to update this data structure. Therefore the functions must spend as little time performing the injected behaviours as possible to avoid repeated attempts

Parameters

param swap

Swap function, maps the current state of the value associated with the key to a new state

method Unit Update (Version<string, K, V> version) Source #

Atomically updates a new item in the map. If the key already exists, then the vector clocks, within the version vector, are compared to ascertain if the proposed version was caused-by, causes, or conflicts with the current version:

* If the proposed version was caused-by the current version, then it is ignored.
* If the proposed version causes the current version, then it is accepted and updated as the latest version
* If the proposed version is in conflict with the current version, then values from both versions are
  passed to ConflictV.Append(v1, v2) for value resolution, and the pairwise-maximum of the two vector-clocks
  is taken to be the new 'time.

Parameters

param version

Version to update

method Unit RemoveOlderThan (DateTime cutoff) Source #

Remove items that are older than the specified time-stamp

Parameters

param cutoff

Cut off time-stamp

method Unit RemoveOlderThan (long timeStamp) Source #

Remove items that are older than the specified time-stamp

Parameters

param timeStamp

Cut off time-stamp

method Unit RemoveDeletedItemsOlderThan (DateTime cutoff) Source #

Remove deleted items that are older than the specified time-stamp

Parameters

param cutoff

Cut off time-stamp

method Unit RemoveDeletedItemsOlderThan (long timeStamp) Source #

Remove deleted items that are older than the specified time-stamp

Parameters

param timeStamp

Cut off time-stamp

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

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

method Version<string, K, V> FindVersion (K value) Source #

Retrieve a value from the map by key

Parameters

param key

Key to find

returns

Found value

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

Convert to a HashMap

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

GetEnumerator - IEnumerable interface

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

method string ToString () Source #

Format the collection as [(key: value), (key: value), (key: value), ...] The ellipsis 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 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 Unit Intersect (IEnumerable<K> rhs) 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 Unit Except (IEnumerable<K> rhs) Source #

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

method bool Equals (object? obj) Source #

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

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

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

method int GetHashCode () Source #

method VersionHashMap<K, V> Where (Func<long, Option<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 VersionHashMap<K, V> Where (Func<K, long, Option<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 VersionHashMap<K, V> Filter (Func<long, Option<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 VersionHashMap<K, V> Filter (Func<K, long, Option<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 Unit FilterInPlace (Func<long, Option<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 Unit FilterInPlace (Func<K, long, Option<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<(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<(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<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<(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