effect-io-ai

Package: effect
Module: MutableHashSet

MutableHashSet.remove

Removes a value from the MutableHashSet.

Time complexity: O(1) average

Syntax

import { MutableHashSet, pipe } from "effect"
import assert from "node:assert/strict"

assert.equal(
  // with `data-last`, a.k.a. `pipeable` API
  pipe(
    MutableHashSet.make(0, 1, 2),
    MutableHashSet.remove(0),
    MutableHashSet.has(0)
  ),
  false
)

assert.equal(
  // or piped with the pipe function
  MutableHashSet.make(0, 1, 2).pipe(
    MutableHashSet.remove(0),
    MutableHashSet.has(0)
  ),
  false
)

assert.equal(
  // or with `data-first` API
  MutableHashSet.remove(MutableHashSet.make(0, 1, 2), 0).pipe(
    MutableHashSet.has(0)
  ),
  false
)

See

Signature

declare const remove: { <V>(key: V): (self: MutableHashSet<V>) => MutableHashSet<V>; <V>(self: MutableHashSet<V>, key: V): MutableHashSet<V>; }

Source

Since v2.0.0