@hackage bitvec1.0.0.0
Unboxed bit vectors
Categories
License
BSD-3-Clause
Maintainer
Andrew Lelechenko <andrew.lelechenko@gmail.com>
Links
Versions
Installation
Tested Compilers
Dependencies (6)
- base >=4.8 && <5
- bits-extra >=0.0.0.4 && <0.1
- ghc-prim
- primitive >=0.5
- semigroups >=0.8
- vector >=0.11 && <0.13 Show all…
Dependents (22)
@hackage/trexio-hs, @hackage/hw-bits, @hackage/galois-field, @hackage/ac-library-hs, @hackage/acme-everything, @hackage/vector-algorithms, Show all…
Package Flags
bmi2
(off by default)
Enable bmi2 instruction set
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 Data.Bit.Bit and a custom instance
of unboxed 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).
Thread safety
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.