https://github.com/viercc/trie-simple
Simple Map-based trie implementation
https://github.com/viercc/trie-simple
datastructures haskell haskell-library
Last synced: 11 days ago
JSON representation
Simple Map-based trie implementation
- Host: GitHub
- URL: https://github.com/viercc/trie-simple
- Owner: viercc
- License: bsd-3-clause
- Created: 2018-03-05T02:38:45.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-04T15:14:17.000Z (11 months ago)
- Last Synced: 2025-03-04T16:27:00.127Z (11 months ago)
- Topics: datastructures, haskell, haskell-library
- Language: Haskell
- Homepage:
- Size: 11.4 MB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 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`.


Each of these benchmarks has two sets of point and errorbars, representing two datasets they are run against.
**Notice**: the datasets are **not** included in the tarball distributed from Hackage.
To run the benchmark, either get the entire repository from the source repository (GitHub) or
modify the benchmark program and supply any dataset of your choice.
## About License
[LICENSE](LICENSE) tells the licence of this project, EXCEPT
one file for benchmark input data. See [ABOUT](ABOUT) for that
file.
If you install `trie-simple` from Hackage, that input data is not
included in the distributed files.