Package: effect
Module: MutableHashSet
Creates a MutableHashSet from a variable number of values. Duplicates are automatically removed.
When to use
Use to build a mutable hash set from explicit values.
Example (Creating a set from values)
import { MutableHashSet } from "effect"
const set = MutableHashSet.make("apple", "banana", "apple", "cherry")
console.log(MutableHashSet.size(set)) // 3
console.log(Array.from(set)) // ["apple", "banana", "cherry"]
// With numbers
const numbers = MutableHashSet.make(1, 2, 3, 2, 1)
console.log(MutableHashSet.size(numbers)) // 3
console.log(Array.from(numbers)) // [1, 2, 3]
// Mixed types
const mixed = MutableHashSet.make("hello", 42, true, "hello")
console.log(MutableHashSet.size(mixed)) // 3
Signature
declare const make: <Keys extends ReadonlyArray<unknown>>(...keys: Keys) => MutableHashSet<Keys[number]>
Since v2.0.0