bytestring-trie

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

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

Version on this page:0.2.4.1@rev:1
LTS Haskell 22.37:0.2.7.5
Stackage Nightly 2024-10-11:0.2.7.5
Latest on Hackage:0.2.7.5

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:f93c8c3ecfdf435f4199a7204b25bbc5c24e19440bd89b935e47ed30c3baa638,4324

Module documentation for 0.2.4.1

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.)