Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/athanclark/pred-trie
predicative lookup container
https://github.com/athanclark/pred-trie
haskell lookup parametric-polymorphism predicates trie
Last synced: 3 days ago
JSON representation
predicative lookup container
- Host: GitHub
- URL: https://github.com/athanclark/pred-trie
- Owner: athanclark
- License: bsd-3-clause
- Created: 2015-04-18T00:28:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-11-20T23:35:29.000Z (almost 6 years ago)
- Last Synced: 2024-04-26T07:02:45.194Z (7 months ago)
- Topics: haskell, lookup, parametric-polymorphism, predicates, trie
- Language: Haskell
- Homepage:
- Size: 1.6 MB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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:```haskell
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](https://github.com/athanclark/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
```bash
stack test
```## Benchmarking
```bash
stack bench --benchmark-arguments="--output profile.html"
```