Hyperlinkv0.8.0-beta.28

Trie

Trie.removeconsteffect/Trie.ts:617
(key: string): <V>(self: Trie<V>) => Trie<V>
<V>(self: Trie<V>, key: string): Trie<V>

Removes the entry for the specified key in the Trie.

Example (Removing entries)

import { Option, Trie } from "effect"
import * as assert from "node:assert"

const trie = Trie.empty<number>().pipe(
  Trie.insert("call", 0),
  Trie.insert("me", 1),
  Trie.insert("mind", 2),
  Trie.insert("mid", 3)
)

const trie1 = trie.pipe(Trie.remove("call"))
const trie2 = trie1.pipe(Trie.remove("mea"))

assert.deepStrictEqual(Trie.get(trie, "call"), Option.some(0))
assert.deepStrictEqual(Trie.get(trie1, "call"), Option.none())
assert.deepStrictEqual(Trie.get(trie2, "call"), Option.none())
mutations
Source effect/Trie.ts:6174 lines
export const remove: {
  (key: string): <V>(self: Trie<V>) => Trie<V>
  <V>(self: Trie<V>, key: string): Trie<V>
} = TR.remove