- HashSet <A>
- Empty = new HashSet<A>(TrieSet<EqDefault<A>, A>.Empty)
- HashSet (IEnumerable<A> items)
- HashSet (IEnumerable<A> items, bool tryAdd)
- item (A key)
- map <B> (Lens<A, A> lens)
- this []
- IsEmpty
- Count
- Length
- Do (Action<A> f)
- Map <R> (Func<A, R> mapper)
- Filter (Func<A, bool> pred)
- Select <R> (Func<A, R> mapper)
- Where (Func<A, bool> pred)
- Add (A key)
- TryAdd (A key)
- AddOrUpdate (A key)
- AddRange (IEnumerable<A> range)
- TryAddRange (IEnumerable<A> range)
- AddOrUpdateRange (IEnumerable<A> range)
- Remove (A key)
- Find (A key)
- FindSeq (A key)
- Find <R> (A key, Func<A, R> Some, Func<R> None)
- SetItem (A key)
- TrySetItem (A key)
- Contains (A key)
- Clear ()
- SetItems (IEnumerable<A> items)
- TrySetItems (IEnumerable<A> items)
- RemoveRange (IEnumerable<A> keys)
- GetEnumerator ()
- ToSeq ()
- ToString ()
- ToFullString (string separator = ", ")
- ToFullArrayString (string separator = ", ")
- AsEnumerable ()
- + (HashSet<A> lhs, HashSet<A> rhs)
- Append (HashSet<A> rhs)
- - (HashSet<A> lhs, HashSet<A> rhs)
- Subtract (HashSet<A> rhs)
- == (HashSet<A> lhs, HashSet<A> rhs)
- != (HashSet<A> lhs, HashSet<A> rhs)
- Equals (HashSet<A> other)
- IsProperSubsetOf (IEnumerable<A> other)
- IsProperSupersetOf (IEnumerable<A> other)
- IsSubsetOf (IEnumerable<A> other)
- Overlaps (IEnumerable<A> other)
- IsSupersetOf (IEnumerable<A> rhs)
- Intersect (IEnumerable<A> rhs)
- Except (IEnumerable<A> rhs)
- SymmetricExcept (HashSet<A> rhs)
- SymmetricExcept (IEnumerable<A> rhs)
- Union (IEnumerable<A> rhs)
- CopyTo (A[] array, int index)
- CopyTo (System.Array array, int index)
- Equals (object obj)
- GetHashCode ()
- Bind <B> (Func<A, HashSet<B>> f)
- SelectMany <B, C> (Func<A, HashSet<B>> bind, Func<A, B, C> project)
- HashSet <EqA, A>
- Empty = new HashSet<EqA, A>(TrieSet<EqA, A>.Empty)
- HashSet (IEnumerable<A> items)
- HashSet (IEnumerable<A> items, bool tryAdd)
- item (A key)
- map <B> (Lens<A, A> lens)
- this []
- IsEmpty
- Count
- Length
- Do (Action<A> f)
- Map <EqR, R> (Func<A, R> mapper)
- Map (Func<A, A> mapper)
- Filter (Func<A, bool> pred)
- Select <EqR, R> (Func<A, R> mapper)
- Where (Func<A, bool> pred)
- Add (A key)
- TryAdd (A key)
- AddOrUpdate (A key)
- AddRange (IEnumerable<A> range)
- TryAddRange (IEnumerable<A> range)
- AddOrUpdateRange (IEnumerable<A> range)
- Remove (A key)
- Find (A key)
- FindSeq (A key)
- Find <R> (A key, Func<A, R> Some, Func<R> None)
- SetItem (A key)
- TrySetItem (A key)
- Contains (A key)
- Clear ()
- SetItems (IEnumerable<A> items)
- TrySetItems (IEnumerable<A> items)
- RemoveRange (IEnumerable<A> keys)
- GetEnumerator ()
- ToSeq ()
- ToString ()
- ToFullString (string separator = ", ")
- ToFullArrayString (string separator = ", ")
- AsEnumerable ()
- + (HashSet<EqA, A> lhs, HashSet<EqA, A> rhs)
- Append (HashSet<EqA, A> rhs)
- - (HashSet<EqA, A> lhs, HashSet<EqA, A> rhs)
- Subtract (HashSet<EqA, A> rhs)
- == (HashSet<EqA, A> lhs, HashSet<EqA, A> rhs)
- != (HashSet<EqA, A> lhs, HashSet<EqA, A> rhs)
- Equals (HashSet<EqA, A> other)
- IsProperSubsetOf (IEnumerable<A> other)
- IsProperSupersetOf (IEnumerable<A> other)
- IsSubsetOf (IEnumerable<A> other)
- IsSupersetOf (IEnumerable<A> rhs)
- Intersect (IEnumerable<A> rhs)
- Overlaps (IEnumerable<A> other)
- Except (IEnumerable<A> rhs)
- SymmetricExcept (HashSet<EqA, A> rhs)
- SymmetricExcept (IEnumerable<A> rhs)
- Union (IEnumerable<A> rhs)
- CopyTo (A[] array, int index)
- CopyTo (System.Array array, int index)
- Equals (object obj)
- GetHashCode ()
- Bind <B> (Func<A, HashSet<B>> f)
- SelectMany <B, C> (Func<A, HashSet<B>> bind, Func<A, B, C> project)
- HashSet
- isEmpty <T> (HashSet<T> set)
- create <T> ()
- createRange <T> (IEnumerable<T> range)
- empty <T> ()
- add <T> (HashSet<T> set, T value)
- tryAdd <T> (HashSet<T> set, T value)
- addOrUpdate <T> (HashSet<T> set, T value)
- find <T> (HashSet<T> set, T value)
- exists <T> (HashSet<T> set, Func<T, bool> pred)
- equals <T> (HashSet<T> setA, HashSet<T> setB)
- length <T> (HashSet<T> set)
- subtract <T> (HashSet<T> setA, HashSet<T> setB)
- union <T> (HashSet<T> setA, HashSet<T> setB)
- filter <T> (HashSet<T> set, Func<T, bool> pred)
- fold <T, S> (HashSet<T> set, S state, Func<S, T, S> folder)
- foldBack <T, S> (HashSet<T> set, S state, Func<S, T, S> folder)
- intersect <T> (HashSet<T> setA, IEnumerable<T> setB)
- except <T> (HashSet<T> setA, IEnumerable<T> setB)
- symmetricExcept <T> (HashSet<T> setA, IEnumerable<T> setB)
- map <T, R> (HashSet<T> set, Func<T, R> mapper)
- contains <T> (HashSet<T> set, T value)
- remove <T> (HashSet<T> set, T value)
- isSubHSet <T> (HashSet<T> setA, IEnumerable<T> setB)
- isSuperHSet <T> (HashSet<T> setA, IEnumerable<T> setB)
- isProperSubHSet <T> (HashSet<T> setA, IEnumerable<T> setB)
- isProperSuperHSet <T> (HashSet<T> setA, IEnumerable<T> setB)
- overlaps <T> (HashSet<T> setA, IEnumerable<T> setB)
- HashSet
- isEmpty <EqT, T> (HashSet<EqT, T> set)
- create <EqT, T> ()
- createRange <EqT, T> (IEnumerable<T> range)
- empty <EqT, T> ()
- add <EqT, T> (HashSet<EqT, T> set, T value)
- tryAdd <EqT, T> (HashSet<EqT, T> set, T value)
- addOrUpdate <EqT, T> (HashSet<EqT, T> set, T value)
- find <EqT, T> (HashSet<EqT, T> set, T value)
- exists <EqT, T> (HashSet<EqT, T> set, Func<T, bool> pred)
- equals <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- length <EqT, T> (HashSet<EqT, T> set)
- subtract <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- union <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- filter <EqT, T> (HashSet<EqT, T> set, Func<T, bool> pred)
- fold <EqT, T, S> (HashSet<EqT, T> set, S state, Func<S, T, S> folder)
- foldBack <EqT, T, S> (HashSet<EqT, T> set, S state, Func<S, T, S> folder)
- intersect <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- except <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- symmetricExcept <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- map <EqT, EqR, T, R> (HashSet<EqT, T> set, Func<T, R> mapper)
- map <EqT, T> (HashSet<EqT, T> set, Func<T, T> mapper)
- contains <EqT, T> (HashSet<EqT, T> set, T value)
- remove <EqT, T> (HashSet<EqT, T> set, T value)
- isSubHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- isSuperHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- isProperSubHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- isProperSuperHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
- overlaps <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB)
Unsorted immutable hash-set
type | A | Key type |
field HashSet<A> Empty = new HashSet<A>(TrieSet<EqDefault<A>, A>.Empty) Source #
method HashSet<A> Do (Action<A> f) Source #
Impure iteration of the bound values in the structure
returns | Returns the original unmodified structure |
method HashSet<R> Map <R> (Func<A, R> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
type | T | Element type |
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method HashSet<A> Filter (Func<A, bool> pred) Source #
Filters items from the set using the predicate. If the predicate returns True for any item then it remains in the set, otherwise it's dropped.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | Filtered enumerable |
method HashSet<R> Select <R> (Func<A, R> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
type | T | Element type |
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method HashSet<A> Where (Func<A, bool> pred) Source #
Filters items from the set using the predicate. If the predicate returns True for any item then it remains in the set, otherwise it's dropped.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | Filtered enumerable |
method HashSet<A> Add (A key) Source #
Add an item to the set
param | value | Value to add to the set |
returns | New set with the item added |
method HashSet<A> TryAdd (A key) Source #
Attempt to add an item to the set. If an item already exists then return the Set as-is.
param | value | Value to add to the set |
returns | New set with the item maybe added |
method HashSet<A> AddOrUpdate (A key) Source #
Add an item to the set. If an item already exists then replace it.
param | value | Value to add to the set |
returns | New set with the item maybe added |
method HashSet<A> AddRange (IEnumerable<A> range) Source #
Atomically adds a range of items to the set.
Null is not allowed for a Key
param | range | Range of keys to add |
returns | New HSet with the items added |
method HashSet<A> TryAddRange (IEnumerable<A> range) Source #
Atomically adds a range of items to the set. If an item already exists, it's ignored.
Null is not allowed for a Key
param | range | Range of keys to add |
returns | New HSet with the items added |
method HashSet<A> AddOrUpdateRange (IEnumerable<A> range) Source #
Atomically adds a range of items to the set. If an item already exists then replace it.
Null is not allowed for a Key
param | range | Range of keys to add |
returns | New HSet with the items added |
method HashSet<A> Remove (A key) Source #
Atomically removes an item from the set If the key doesn't exists, the request is ignored.
param | key | Key |
returns | New map with the item removed |
method Option<A> Find (A key) Source #
Retrieve a value from the set by key
param | key | Key to find |
returns | Found value |
method IEnumerable<A> FindSeq (A key) Source #
Retrieve a value from the set by key as an enumerable
param | key | Key to find |
returns | Found value |
method R Find <R> (A key, Func<A, R> Some, Func<R> None) Source #
Retrieve a value from the set by key and pattern match the result.
param | key | Key to find |
returns | Found value |
method HashSet<A> SetItem (A key) Source #
Atomically updates an existing item
Null is not allowed for a key
param | key | Key |
returns | New HSet with the item added |
method HashSet<A> TrySetItem (A key) Source #
Atomically updates an existing item, unless it doesn't exist, in which case it is ignored
Null is not allowed for a key
param | key | Key |
param | value | Value |
returns | New HSet with the item added |
method bool Contains (A key) Source #
Checks for existence of a key in the set
param | key | Key to check |
returns | True if an item with the key supplied is in the set |
method HashSet<A> Clear () Source #
Clears all items from the set
Functionally equivalent to calling HSet.empty as the original structure is untouched
returns | Empty HSet |
method HashSet<A> SetItems (IEnumerable<A> items) Source #
Atomically sets a series of items
param | items | Items to set |
returns | New HSet with the items set |
method HashSet<A> TrySetItems (IEnumerable<A> items) Source #
Atomically sets a series of items. If any of the items don't exist then they're silently ignored.
param | items | Items to set |
returns | New HSet with the items set |
method HashSet<A> RemoveRange (IEnumerable<A> keys) Source #
Atomically removes a list of keys from the set
param | keys | Keys to remove |
returns | New HSet with the items removed |
method IEnumerator<A> GetEnumerator () Source #
GetEnumerator - IEnumerable interface
method string ToString () Source #
Format the collection as [a, b, c, ...]
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 a, b, c, ...
method string ToFullArrayString (string separator = ", ") Source #
Format the collection as [a, b, c, ...]
method IEnumerable<A> AsEnumerable () Source #
method bool IsProperSubsetOf (IEnumerable<A> other) Source #
Returns True if 'other' is a proper subset of this set
returns | True if 'other' is a proper subset of this set |
method bool IsProperSupersetOf (IEnumerable<A> other) Source #
Returns True if 'other' is a proper superset of this set
returns | True if 'other' is a proper superset of this set |
method bool IsSubsetOf (IEnumerable<A> other) Source #
Returns True if 'other' is a superset of this set
returns | True if 'other' is a superset of this set |
method bool IsSupersetOf (IEnumerable<A> rhs) Source #
Returns True if 'other' is a superset of this set
returns | True if 'other' is a superset of this set |
method HashSet<A> Intersect (IEnumerable<A> rhs) Source #
Returns the elements that are in both this and other
method HashSet<A> Except (IEnumerable<A> rhs) Source #
Returns this - other. Only the items in this that are not in other will be returned.
method HashSet<A> SymmetricExcept (HashSet<A> 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 HashSet<A> SymmetricExcept (IEnumerable<A> 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 HashSet<A> Union (IEnumerable<A> rhs) Source #
Finds the union of two sets and produces a new set with the results
param | other | Other set to union with |
returns | A set which contains all items from both sets |
method Unit CopyTo (A[] array, int index) Source #
Copy the items from the set into the specified array
param | array | Array to copy to |
param | index | Index into the array to start |
method Unit CopyTo (System.Array array, int index) Source #
Copy the items from the set into the specified array
param | array | Array to copy to |
param | index | Index into the array to start |
method int GetHashCode () Source #
method HashSet<C> SelectMany <B, C> (Func<A, HashSet<B>> bind, Func<A, B, C> project) Source #
struct HashSet <EqA, A> Source #
Unsorted immutable hash-set
type | A | Key type |
field HashSet<EqA, A> Empty = new HashSet<EqA, A>(TrieSet<EqA, A>.Empty) Source #
method HashSet<EqA, A> Do (Action<A> f) Source #
Impure iteration of the bound values in the structure
returns | Returns the original unmodified structure |
method HashSet<EqR, R> Map <EqR, R> (Func<A, R> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method HashSet<EqA, A> Map (Func<A, A> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method HashSet<EqA, A> Filter (Func<A, bool> pred) Source #
Filters items from the set using the predicate. If the predicate returns True for any item then it remains in the set, otherwise it's dropped.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | Filtered enumerable |
method HashSet<EqR, R> Select <EqR, R> (Func<A, R> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method HashSet<EqA, A> Where (Func<A, bool> pred) Source #
Filters items from the set using the predicate. If the predicate returns True for any item then it remains in the set, otherwise it's dropped.
param | set | HSet |
param | pred | Predicate |
returns | Filtered enumerable |
method HashSet<EqA, A> Add (A key) Source #
Add an item to the set
param | value | Value to add to the set |
returns | New set with the item added |
method HashSet<EqA, A> TryAdd (A key) Source #
Attempt to add an item to the set. If an item already exists then return the Set as-is.
param | value | Value to add to the set |
returns | New set with the item maybe added |
method HashSet<EqA, A> AddOrUpdate (A key) Source #
Add an item to the set. If an item already exists then replace it.
param | value | Value to add to the set |
returns | New set with the item maybe added |
method HashSet<EqA, A> AddRange (IEnumerable<A> range) Source #
Atomically adds a range of items to the set.
Null is not allowed for a Key
param | range | Range of keys to add |
returns | New HSet with the items added |
method HashSet<EqA, A> TryAddRange (IEnumerable<A> range) Source #
Atomically adds a range of items to the set. If an item already exists, it's ignored.
Null is not allowed for a Key
param | range | Range of keys to add |
returns | New HSet with the items added |
method HashSet<EqA, A> AddOrUpdateRange (IEnumerable<A> range) Source #
Atomically adds a range of items to the set. If an item already exists then replace it.
Null is not allowed for a Key
param | range | Range of keys to add |
returns | New HSet with the items added |
method HashSet<EqA, A> Remove (A key) Source #
Atomically removes an item from the set If the key doesn't exists, the request is ignored.
param | key | Key |
returns | New map with the item removed |
method Option<A> Find (A key) Source #
Retrieve a value from the set by key
param | key | Key to find |
returns | Found value |
method IEnumerable<A> FindSeq (A key) Source #
Retrieve a value from the set by key as an enumerable
param | key | Key to find |
returns | Found value |
method R Find <R> (A key, Func<A, R> Some, Func<R> None) Source #
Retrieve a value from the set by key and pattern match the result.
param | key | Key to find |
returns | Found value |
method HashSet<EqA, A> SetItem (A key) Source #
Atomically updates an existing item
Null is not allowed for a key
param | key | Key |
returns | New HSet with the item added |
method HashSet<EqA, A> TrySetItem (A key) Source #
Atomically updates an existing item, unless it doesn't exist, in which case it is ignored
Null is not allowed for a key
param | key | Key |
param | value | Value |
returns | New HSet with the item added |
method bool Contains (A key) Source #
Checks for existence of a key in the set
param | key | Key to check |
returns | True if an item with the key supplied is in the set |
method HashSet<EqA, A> Clear () Source #
Clears all items from the set
Functionally equivalent to calling HSet.empty as the original structure is untouched
returns | Empty HSet |
method HashSet<EqA, A> SetItems (IEnumerable<A> items) Source #
Atomically sets a series of items
param | items | Items to set |
returns | New HSet with the items set |
method HashSet<EqA, A> TrySetItems (IEnumerable<A> items) Source #
Atomically sets a series of items. If any of the items don't exist then they're silently ignored.
param | items | Items to set |
returns | New HSet with the items set |
method HashSet<EqA, A> RemoveRange (IEnumerable<A> keys) Source #
Atomically removes a list of keys from the set
param | keys | Keys to remove |
returns | New HSet with the items removed |
method IEnumerator<A> GetEnumerator () Source #
GetEnumerator - IEnumerable interface
method string ToString () Source #
Format the collection as [a, b, c, ...]
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 a, b, c, ...
method string ToFullArrayString (string separator = ", ") Source #
Format the collection as [a, b, c, ...]
method IEnumerable<A> AsEnumerable () Source #
method bool IsProperSubsetOf (IEnumerable<A> other) Source #
Returns True if 'other' is a proper subset of this set
returns | True if 'other' is a proper subset of this set |
method bool IsProperSupersetOf (IEnumerable<A> other) Source #
Returns True if 'other' is a proper superset of this set
returns | True if 'other' is a proper superset of this set |
method bool IsSubsetOf (IEnumerable<A> other) Source #
Returns True if 'other' is a superset of this set
returns | True if 'other' is a superset of this set |
method bool IsSupersetOf (IEnumerable<A> rhs) Source #
Returns True if 'other' is a superset of this set
returns | True if 'other' is a superset of this set |
method HashSet<EqA, A> Intersect (IEnumerable<A> rhs) Source #
Returns the elements that are in both this and other
method HashSet<EqA, A> Except (IEnumerable<A> rhs) Source #
Returns this - other. Only the items in this that are not in other will be returned.
method HashSet<EqA, A> SymmetricExcept (HashSet<EqA, A> 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 HashSet<EqA, A> SymmetricExcept (IEnumerable<A> 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 HashSet<EqA, A> Union (IEnumerable<A> rhs) Source #
Finds the union of two sets and produces a new set with the results
param | other | Other set to union with |
returns | A set which contains all items from both sets |
method Unit CopyTo (A[] array, int index) Source #
Copy the items from the set into the specified array
param | array | Array to copy to |
param | index | Index into the array to start |
method Unit CopyTo (System.Array array, int index) Source #
Copy the items from the set into the specified array
param | array | Array to copy to |
param | index | Index into the array to start |
method int GetHashCode () Source #
method HashSet<C> SelectMany <B, C> (Func<A, HashSet<B>> bind, Func<A, B, C> project) Source #
Immutable hash-set module
method bool isEmpty <T> (HashSet<T> set) Source #
True if the set has no elements
type | T | Element type |
returns | True if the set has no elements |
method HashSet<T> create <T> () Source #
Create a new empty set
type | T | Element type |
returns | Empty HSet |
method HashSet<T> createRange <T> (IEnumerable<T> range) Source #
Create a new set pre-populated with the items in range
type | T | Element type |
param | range | Range of items |
returns | HSet |
method HashSet<T> empty <T> () Source #
Create a new empty set
type | T | Element type |
returns | Empty HSet |
method HashSet<T> add <T> (HashSet<T> set, T value) Source #
Add an item to the set
type | T | Element type |
param | set | Set to add item to |
param | value | Value to add to the HSet |
returns | New set with the item added |
method HashSet<T> tryAdd <T> (HashSet<T> set, T value) Source #
Attempt to add an item to the set. If an item already exists then return the Set as-is.
type | T | Element type |
param | set | Set to add item to |
param | value | Value to add to the HSet |
returns | New set with the item maybe added |
method HashSet<T> addOrUpdate <T> (HashSet<T> set, T value) Source #
Add an item to the set. If an item already exists then replace it.
type | T | Element type |
param | set | Set to add item to |
param | value | Value to add to the HSet |
returns | New set with the item maybe added |
method Option<T> find <T> (HashSet<T> set, T value) Source #
Attempts to find an item in the set.
type | T | Element type |
param | set | HSet |
param | value | Value to find |
returns | Some(T) if found, None otherwise |
method bool exists <T> (HashSet<T> set, Func<T, bool> pred) Source #
Check the existence of an item in the set using a predicate.
Note this scans the entire set.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | True if predicate returns true for any item |
method bool equals <T> (HashSet<T> setA, HashSet<T> setB) Source #
Returns true if both sets contain the same elements
method int length <T> (HashSet<T> set) Source #
Get the number of elements in the set
type | T | Element type |
param | set | HSet |
returns | Number of elements |
method HashSet<T> subtract <T> (HashSet<T> setA, HashSet<T> setB) Source #
Returns setA - setB. Only the items in setA that are not in setB will be returned.
method HashSet<T> union <T> (HashSet<T> setA, HashSet<T> setB) Source #
Finds the union of two sets and produces a new set with the results
type | T | Element type |
param | setA | Set A |
param | setB | Set A |
returns | A set which contains all items from both sets |
method HashSet<T> filter <T> (HashSet<T> set, Func<T, bool> pred) Source #
Filters items from the set using the predicate. If the predicate returns True for any item then it remains in the set, otherwise it's dropped.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | Filtered enumerable |
method S fold <T, S> (HashSet<T> set, S state, Func<S, T, S> folder) Source #
Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the set. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result. (Aggregate in LINQ)
type | S | State type |
type | T | Set element type |
param | set | Set to fold |
param | state | Initial state |
param | folder | Fold function |
returns | Aggregate value |
method S foldBack <T, S> (HashSet<T> set, S state, Func<S, T, S> folder) Source #
Applies a function 'folder' to each element of the collection (from last element to first), threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the set. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.
type | S | State type |
type | T | Set element type |
param | set | Set to fold |
param | state | Initial state |
param | folder | Fold function |
returns | Aggregate value |
method HashSet<T> intersect <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Returns the elements that are in both setA and setB
method HashSet<T> except <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Returns the elements that are in both setA and setB
method HashSet<T> symmetricExcept <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Only items that are in one set or the other will be returned. If an item is in both, it is dropped.
method HashSet<R> map <T, R> (HashSet<T> set, Func<T, R> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
type | T | Element type |
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method bool contains <T> (HashSet<T> set, T value) Source #
Returns True if the value is in the set
type | T | Element type |
param | set | HSet |
param | value | Value to check |
returns | True if the item 'value' is in the Set 'set' |
method HashSet<T> remove <T> (HashSet<T> set, T value) Source #
Removes an item from the set (if it exists)
type | T | Element type |
param | set | HSet |
param | value | Value to check |
returns | New set with item removed |
method bool isSubHSet <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Returns True if setB is a subset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a subset of setA |
method bool isSuperHSet <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Returns True if setB is a superset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a superset of setA |
method bool isProperSubHSet <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Returns True if setB is a proper subset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a proper subset of setA |
method bool isProperSuperHSet <T> (HashSet<T> setA, IEnumerable<T> setB) Source #
Returns True if setB is a proper superset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a proper subset of setA |
Immutable hash-set module
method bool isEmpty <EqT, T> (HashSet<EqT, T> set) Source #
True if the set has no elements
type | T | Element type |
returns | True if the set has no elements |
method HashSet<EqT, T> create <EqT, T> () Source #
Create a new empty set
type | T | Element type |
returns | Empty HSet |
method HashSet<EqT, T> createRange <EqT, T> (IEnumerable<T> range) Source #
Create a new set pre-populated with the items in range
type | T | Element type |
param | range | Range of items |
returns | HSet |
method HashSet<EqT, T> empty <EqT, T> () Source #
Create a new empty set
type | T | Element type |
returns | Empty HSet |
method HashSet<EqT, T> add <EqT, T> (HashSet<EqT, T> set, T value) Source #
Add an item to the set
type | T | Element type |
param | set | Set to add item to |
param | value | Value to add to the HSet |
returns | New set with the item added |
method HashSet<EqT, T> tryAdd <EqT, T> (HashSet<EqT, T> set, T value) Source #
Attempt to add an item to the set. If an item already exists then return the Set as-is.
type | T | Element type |
param | set | Set to add item to |
param | value | Value to add to the HSet |
returns | New set with the item maybe added |
method HashSet<EqT, T> addOrUpdate <EqT, T> (HashSet<EqT, T> set, T value) Source #
Add an item to the set. If an item already exists then replace it.
type | T | Element type |
param | set | Set to add item to |
param | value | Value to add to the HSet |
returns | New set with the item maybe added |
method Option<T> find <EqT, T> (HashSet<EqT, T> set, T value) Source #
Attempts to find an item in the set.
type | T | Element type |
param | set | HSet |
param | value | Value to find |
returns | Some(T) if found, None otherwise |
method bool exists <EqT, T> (HashSet<EqT, T> set, Func<T, bool> pred) Source #
Check the existence of an item in the set using a predicate.
Note this scans the entire set.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | True if predicate returns true for any item |
method bool equals <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns true if both sets contain the same elements
method int length <EqT, T> (HashSet<EqT, T> set) Source #
Get the number of elements in the set
type | T | Element type |
param | set | HSet |
returns | Number of elements |
method HashSet<EqT, T> subtract <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns setA - setB. Only the items in setA that are not in setB will be returned.
method HashSet<EqT, T> union <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Finds the union of two sets and produces a new set with the results
type | T | Element type |
param | setA | Set A |
param | setB | Set A |
returns | A set which contains all items from both sets |
method HashSet<EqT, T> filter <EqT, T> (HashSet<EqT, T> set, Func<T, bool> pred) Source #
Filters items from the set using the predicate. If the predicate returns True for any item then it remains in the set, otherwise it's dropped.
type | T | Element type |
param | set | HSet |
param | pred | Predicate |
returns | Filtered enumerable |
method S fold <EqT, T, S> (HashSet<EqT, T> set, S state, Func<S, T, S> folder) Source #
Applies a function 'folder' to each element of the collection, threading an accumulator argument through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the set. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result. (Aggregate in LINQ)
type | S | State type |
type | T | Set element type |
param | set | Set to fold |
param | state | Initial state |
param | folder | Fold function |
returns | Aggregate value |
method S foldBack <EqT, T, S> (HashSet<EqT, T> set, S state, Func<S, T, S> folder) Source #
Applies a function 'folder' to each element of the collection (from last element to first), threading an aggregate state through the computation. The fold function takes the state argument, and applies the function 'folder' to it and the first element of the set. Then, it feeds this result into the function 'folder' along with the second element, and so on. It returns the final result.
type | S | State type |
type | T | Set element type |
param | set | Set to fold |
param | state | Initial state |
param | folder | Fold function |
returns | Aggregate value |
method HashSet<EqT, T> intersect <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns the elements that are in both setA and setB
method HashSet<EqT, T> except <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns the elements that are in both setA and setB
method HashSet<EqT, T> symmetricExcept <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Only items that are in one set or the other will be returned. If an item is in both, it is dropped.
method HashSet<EqR, R> map <EqT, EqR, T, R> (HashSet<EqT, T> set, Func<T, R> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to transform the source values.
type | T | Element type |
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method HashSet<EqT, T> map <EqT, T> (HashSet<EqT, T> set, Func<T, T> mapper) Source #
Maps the values of this set into a new set of values using the mapper function to tranform the source values.
type | T | Element type |
type | R | Mapped element type |
param | set | HSet |
param | mapper | Mapping function |
returns | Mapped enumerable |
method bool contains <EqT, T> (HashSet<EqT, T> set, T value) Source #
Returns True if the value is in the set
type | T | Element type |
param | set | HSet |
param | value | Value to check |
returns | True if the item 'value' is in the Set 'set' |
method HashSet<EqT, T> remove <EqT, T> (HashSet<EqT, T> set, T value) Source #
Removes an item from the set (if it exists)
type | T | Element type |
param | set | HSet |
param | value | Value to check |
returns | New set with item removed |
method bool isSubHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns True if setB is a subset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a subset of setA |
method bool isSuperHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns True if setB is a superset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a superset of setA |
method bool isProperSubHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns True if setB is a proper subset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a proper subset of setA |
method bool isProperSuperHSet <EqT, T> (HashSet<EqT, T> setA, HashSet<EqT, T> setB) Source #
Returns True if setB is a proper superset of setA
type | T | Element type |
param | setA | Set A |
param | setB | Set B |
returns | True is setB is a proper subset of setA |