Package: effect
Module: MutableHashSet
Removes all values from the MutableHashSet.
This function operates by delegating the clearing action to the underlying
key map associated with the given MutableHashSet. It ensures that the hash
set becomes empty while maintaining its existence and structure.
Example
import { MutableHashSet, pipe } from "effect"
import assert from "node:assert/strict"
assert.deepStrictEqual(
pipe(
MutableHashSet.make(1, 2, 3, 4),
MutableHashSet.clear,
MutableHashSet.size
),
0
)
See
MutableHashSet elements are module:MutableHashSet.add module:MutableHashSet.has module:MutableHashSet.remove module:MutableHashSet.sizeSignature
declare const clear: <V>(self: MutableHashSet<V>) => MutableHashSet<V>
Since v2.0.0