trie-simple

Simple Map-based Trie

Version on this page:0.4.1.1@rev:5
LTS Haskell 22.17:0.4.2@rev:2
Stackage Nightly 2024-04-14:0.4.2@rev:2
Latest on Hackage:0.4.2@rev:2

See all snapshots trie-simple appears in

BSD-3-Clause licensed by Koji Miyazato
Maintained by [email protected]
This version can be pinned in stack with:trie-simple-0.4.1.1@sha256:4f00109ee3a68a6051395f18639cce2080598582504eda66bc9f82e771362702,2625

Module documentation for 0.4.1.1

trie-simple

Trie data structure TMap to hold mapping from list of characters to something, i.e. isomorphic to Map [c] v. This package also contains TSet, which is isomorphic to Set of lists of characters.

This package implements these structures using Map from containers package, and require the character type to be only Ord.

Advantages of using this package over Map or Set are:

  • 2x Faster lookup (member) operation
  • Retrieving subset of map or set with given prefix
  • append, prefixes, and suffixes support
  • Can be more memory-efficient (but not always; needs benchmark anyway).

Benchmarks

Benchmarks compared against plain Map and Set.

benchmark chart for TMap

benchmark chart for TSet

About License

LICENSE tells the licence of this project, EXCEPT one file for benchmark input data. See ABOUT for that file.

If you install trie-simple from Hackage, that input data is not included in the distributed files.

Changes

0.4.1.1

  • Initial release.