bytestring-trie

An efficient finite map from (byte)strings to values.

http://code.haskell.org/~wren/

Version on this page:0.2.4.1
LTS Haskell 22.13:0.2.7.2
Stackage Nightly 2023-12-26:0.2.7.2
Latest on Hackage:0.2.7.2

See all snapshots bytestring-trie appears in

BSD-3-Clause licensed by wren gayle romano
Maintained by [email protected]
This version can be pinned in stack with:bytestring-trie-0.2.4.1@sha256:fda9d87fcd5cbfd4a3f263f2245b6fcd684f863f0da47ab1f93603e8ce3a1d31,4307

Module documentation for 0.2.4.1

Used by 2 packages in lts-8.5(full list with versions):

An efficient finite map from (byte)strings to values.

The implementation is based on big-endian patricia trees, like Data.IntMap. We first trie on the elements of Data.ByteString and then trie on the big-endian bit representation of those elements. Patricia trees have efficient algorithms for union and other merging operations, but they're also quick for lookups and insertions.

If you are only interested in being able to associate strings to values, then you may prefer the hashmap package which is faster for those only needing a map-like structure. This package is intended for those who need the extra capabilities that a trie-like structure can offer (e.g., structure sharing to reduce memory costs for highly redundant keys, taking the submap of all keys with a given prefix, contextual mapping, extracting the minimum and maximum keys, etc.)