Hyperlinkv0.8.0-beta.28

HashSet

HashSet.removeconsteffect/HashSet.ts:296
<V>(value: V): (self: HashSet<V>) => HashSet<V>
<V>(self: HashSet<V>, value: V): HashSet<V>

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
mutations
Source effect/HashSet.ts:2967 lines
export const remove: {
  <V>(value: V): (self: HashSet<V>) => HashSet<V>
  <V>(self: HashSet<V>, value: V): HashSet<V>
} = Dual.dual<
  <V>(value: V) => (self: HashSet<V>) => HashSet<V>,
  <V>(self: HashSet<V>, value: V) => HashSet<V>
>(2, internal.remove)
Referenced by 1 symbols