Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sgraf812/pomaps
Haskell data structure for maps and sets with partially ordered keys
https://github.com/sgraf812/pomaps
Last synced: 3 months ago
JSON representation
Haskell data structure for maps and sets with partially ordered keys
- Host: GitHub
- URL: https://github.com/sgraf812/pomaps
- Owner: sgraf812
- License: other
- Created: 2017-08-17T15:07:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-02-07T20:05:58.000Z (almost 4 years ago)
- Last Synced: 2024-04-26T00:30:50.877Z (9 months ago)
- Language: Haskell
- Size: 324 KB
- Stars: 3
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [`pomaps`][pomaps] [![Build Status](https://github.com/sgraf812/pomaps/workflows/Haskell-CI/badge.svg)](https://github.com/sgraf812/pomaps/actions) [![Hackage](https://img.shields.io/hackage/v/pomaps.svg)](https://hackage.haskell.org/package/pomaps)
Reasonably fast maps (and possibly sets) based on keys satisfying [`PartialOrd`](https://hackage.haskell.org/package/lattices-1.6.0/docs/Algebra-PartialOrd.html#t:PartialOrd).
This package tries to load off as much work as possible to the excellent [`containers`](https://hackage.haskell.org/package/containers) library, in order to achieve acceptable performance.
The interface is kept as similar to [`Data.Map.{Strict,Lazy}`](https://hackage.haskell.org/package/containers/docs/Data-Map-Strict.html) as possible, which is an excuse for somewhat lacking documentation.`POMap`s basically store a decomposition of totally ordered chains (e.g. something `Map`s can handle).
Functionality and strictness properties should be pretty much covered by the testsuite.
But it's not battle-tested yet, so if you encounter space leaks in the implementation, let me know.A rather naive implementation leads to `O(w*n*log n)` lookups, where `w` is the width of the decomposition (which should be the size of the biggest anti-chain).
This is enough for me at the moment to get things going, but there is room for improvement ([Sorting and Selection in Posets](https://arxiv.org/abs/0707.1532)).
Let me know if things are too slow and I'll see what I can do![pomaps]: https://github.com/sgraf812/pomaps