@hackage pred-trie0.6.1
Predicative tries
Installation
Dependencies (13)
- QuickCheck >=2.9.2
- base >=4.11 && <5.0
- containers
- deepseq
- hashable
- hashtables Show all…
Dependents (2)
@hackage/sparrow, @hackage/nested-routes
pred-trie
A predicative trie library - use predicates instead of literal match to capture classes of results, instead of enumerating distinguished ones.
Usage
The predicates are existentially quantified such that a predicate creates an unknown type, while it's result must have the necessary arity, matching the quantified type, to fulfill the lookup:
PredTrie s a
= PNil
| forall t. PCons
{ predicate :: s -> Maybe t
, result :: t -> a
}
...basically.
I broke the lookup phases into "steps", like the tries
package, and used the fastest-lookup HashMapStep trie implementation for the
literal lookups. For more info, read the code :D
How to run tests
stack test
Benchmarking
stack bench --benchmark-arguments="--output profile.html"