LicenseRef-PublicDomain licensed by James Cook, Andrew Lelechenko
Maintained by Andrew Lelechenko

Module documentation for

This version can be pinned in stack with:bitvec-,1922

Bit vectors library for Haskell. The current vector package represents unboxed arrays of Bool allocating one byte per boolean, which might be considered wasteful. This library provides a newtype wrapper Bit and a custom instance of 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).


  • 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 MVector and Vector instances of Bit.
  • Speed up MVector and Vector instances of Bit.
Depends on 3 packages(full list with versions):
comments powered byDisqus