-
Effekt Library
- dictionary
- Dictionary
- Empty
- Leaf
- Branch
- Node
- insert
- insert
- lookup
- lookup
- Tagged
- collect
- each
- eachTagged
- dictionary Jump to source: libraries/common/dictionary.effekt
- Dictionary
[A] - Empty
- Leaf
(value: A) - Branch
(children: Array[Dictionary[A]]) - Node
(value: A, children: Array[Dictionary[A]]) - insert
[A] (trie: Dictionary[A], key: String, value: A): Dictionary[A] / {} - insert
[A] (trie: Dictionary[A], key: ByteArray, value: A): Dictionary[A] / {} - lookup
[A] (trie: Dictionary[A], key: String): Option[A] / {} - lookup
[A] (trie: Dictionary[A], key: ByteArray): Option[A] / {} - Tagged
[A] (key: ByteArray, value: A) - collect
[A] { stream: => Unit / {emit[Tagged[A]]} }: Dictionary[A] / {} - each
[A] (trie: Dictionary[A]): Unit / {emit[A]} - eachTagged
[A] (trie: Dictionary[A]): Unit / {emit[Tagged[A]]}
Example usage: examples/stdlib/dictionary
A trie-based dictionary for efficient key-value storage with bytearray keys. Supports String and ByteArray keys with fast lookup and insertion.
Insert a value with a String key.
Insert a key-value pair into the dictionary with a ByteArray key.
Look up a value in the dictionary by string key.
Look up a value in the dictionary by bytearray key.
A record pairing a key with a value for use in streams.
Collect key-value pairs from a stream of Tagged elements into a Dictionary.
Emit all values stored in the dictionary as a push stream.
Emit all key-value pairs stored in the dictionary as a push stream of Tagged elements.