Skip to content
Ivan Pidhurskyi edited this page Nov 26, 2025 · 1 revision

Trie Type

type trie(K, V)

Persistent hash trie data structure.

Constructors:

  • trie() - Empty trie

Operations:

  • insert(trie, key, value) - Insert key-value pair (returns new trie)
  • remove(trie, key) - Remove key (returns new trie)
  • get(trie, key, default) - Lookup key with default value if not found
  • trie[key] - Access value by key
  • contains(trie, key) - Check if key exists in trie
  • length(trie) - Get number of entries in trie
  • empty(trie) - Check if trie is empty

Clone this wiki locally