Skip to main content

interface OrderedHashSet.NonEmpty<T>

A non-empty type-invariant immutable Ordered HashSet of value type T. In the Set, there are no duplicate values. See the Set documentation and the OrderedHashSet API documentation

Type parameters

NameDescription
Tthe value type
note
  • The OrderedHashSet keeps the insertion order of values, thus iterators and stream will also reflect this order. - The OrderedHashSet wraps around a HashSet instance, thus has the same time complexity as the HashSet. - The OrderedHashSet keeps the key insertion order in a List, thus its space complexity is higher than a regular HashSet.
example
const s1 = OrderedHashSet.empty<string>()
const s2 = OrderedHashSet.of('a', 'b', 'c')

Methods

stream

undocumented

Definition

stream(options?: {
      reverse?: boolean;
    }): Stream.NonEmpty<T>;

Parameters

NameTypeDescription
options{
      reverse?: boolean;
    }