Bit vectors library for Haskell.
The current vector
package represents unboxed arrays of
allocating one byte per boolean, which might be considered wasteful.
This library provides a newtype wrapper
Data.Bit.Bit and a custom instance
Data.Vector.Unboxed.Vector, which packs booleans densely.
It is a time-memory tradeoff: 8x less memory footprint
at the price of moderate performance penalty
(mostly, for random writes).
Data.Bitis faster, but thread-unsafe. This is because naive updates are not atomic operations: read the whole word from memory, modify a bit, write the whole word back.
Data.Bit.ThreadSafeis slower (up to 2x), but thread-safe.
- Redesign API from the scratch.
- Add a thread-safe implementation.
- Add ‘nthBitIndex’ function.
- Fix ‘Read’ instance.
- Remove hand-written ‘Num’, ‘Real’, ‘Integral’, ‘Bits’ instances.
- Derive ‘Bits’ and ‘FiniteBits’ instances.
- Expose ‘Bit’ constructor directly and remove ‘fromBool’ function.
- Rename ‘toBool’ to ‘unBit’.
- Fix bugs in
- Speed up