Package: effect
Module: MutableHashSet
Checks whether the MutableHashSet contains the specified value.
When to use
Use to test whether a mutable set currently contains a value.
Details
Membership follows the same hashing and equality rules as the underlying
MutableHashMap.
Example (Checking for a value)
import { MutableHashSet } from "effect"
const set = MutableHashSet.make("apple", "banana", "cherry")
console.log(MutableHashSet.has(set, "apple")) // true
console.log(MutableHashSet.has(set, "grape")) // false
// Pipe-able version
const hasApple = MutableHashSet.has("apple")
console.log(hasApple(set)) // true
// Check after adding
MutableHashSet.add(set, "grape")
console.log(MutableHashSet.has(set, "grape")) // true
See
add for adding a value to the setremove for removing a value from the setSignature
declare const has: { <V>(key: V): (self: MutableHashSet<V>) => boolean; <V>(self: MutableHashSet<V>, key: V): boolean; }
Since v2.0.0