byte-containers: Sets and maps with 8-bit words for keys
This library provides variant of Data.Map
and Data.Set
from
the containers
library where the key is specialized to Word8
.
Internally, this uses a 256-bit bitmask for the presence of keys
and a SmallArray
of values of keys that were present. For example,
the map {2 => Z, 3 => B, 5 => X, 9 => A}
would be repsented in
memory as:
Bitmask: 0011010001000000... (240 more zero bits) Value Array: Z,B,X,A
This is optimized for reads. Lookup is O(1)
. Union is technically
O(1)
but only because the universe of keys is finite. The current
implementation always scans through all 256 bits of key space.
Downloads
- byte-containers-0.1.0.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
Versions [RSS] | 0.1.0.0, 0.1.0.1 |
---|---|
Change log | CHANGELOG.md |
Dependencies | base (>=4.12 && <5), primitive (>=0.7 && <0.10), run-st (>=0.1 && <0.2), wide-word (>=0.1.1 && <0.2) [details] |
License | BSD-3-Clause |
Copyright | 2020 Andrew Martin |
Author | Andrew Martin |
Maintainer | amartin@layer3com.com |
Category | Data |
Home page | https://github.com/byteverse/byte-containers |
Bug tracker | https://github.com/byteverse/byte-containers/issues |
Source repo | head: git clone git://github.com/byteverse/byte-containers.git |
Uploaded | by l3c_amartin at 2024-01-31T19:09:07Z |
Distributions | NixOS:0.1.0.1 |
Reverse Dependencies | 1 direct, 0 indirect [details] |
Downloads | 99 total (7 in the last 30 days) |
Rating | (no votes yet) [estimated by Bayesian average] |
Your Rating | |
Status | Docs available [build log] Last success reported on 2024-01-31 [all 1 reports] |