Package: effect
Module: HashSet
Creates an empty HashSet.
Time complexity: O(1)
Example
import { HashSet, pipe } from "effect"
console.log(
pipe(
// Provide a type argument to create a HashSet of a specific type
HashSet.empty<number>(),
HashSet.add(1),
HashSet.add(1), // Notice the duplicate
HashSet.add(2),
HashSet.toValues
)
) // Output: [1, 2]
See
HashSet constructors are module:HashSet.make module:HashSet.fromIterableSignature
declare const empty: <A = never>() => HashSet<A>
Since v2.0.0