interface HashSet<T>
A type-invariant immutable Set of value type T. In the Set, there are no duplicate values. See the Set documentation and the HashSet API documentation
Companion namespace: HashSet
Implemented by: HashSetEmpty<T>
, HashSet.NonEmpty<T>
Type parameters
Name | Description |
---|---|
T | the value type |
note
- The
HashSet
uses the context'shasher
instance to hash keys for performance.<b/r> - TheHashSet
uses the context'seq
function to determine equivalence between keys.
example
const s1 = HashSet.empty<string>()
const s2 = HashSet.of('a', 'b', 'c')