Package: effect
Module: HashSet
Removes a value from the HashSet, returning a new HashSet.
Example (Removing values from a HashSet)
import { HashSet } from "effect"
const set = HashSet.make("a", "b", "c")
const withoutB = HashSet.remove(set, "b")
console.log(HashSet.size(set)) // 3 (original unchanged)
console.log(HashSet.size(withoutB)) // 2
console.log(HashSet.has(withoutB, "b")) // false
// Removing non-existent value has no effect
const same = HashSet.remove(set, "d")
console.log(HashSet.size(same)) // 3
Signature
declare const remove: { <V>(value: V): (self: HashSet<V>) => HashSet<V>; <V>(self: HashSet<V>, value: V): HashSet<V>; }
Since v2.0.0