Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Data.BloomFilter.BitVec64
Description
Minimal bit vector implementation.
Synopsis
- newtype BitVec64 = BV64 (Vector Word64)
- unsafeIndex :: BitVec64 -> Int -> Bool
- prefetchIndex :: BitVec64 -> Int -> ST s ()
- newtype MBitVec64 s = MBV64 (MVector s Word64)
- new :: Word64 -> ST s (MBitVec64 s)
- unsafeWrite :: MBitVec64 s -> Word64 -> Bool -> ST s ()
- unsafeRead :: MBitVec64 s -> Word64 -> ST s Bool
- freeze :: MBitVec64 s -> ST s BitVec64
- unsafeFreeze :: MBitVec64 s -> ST s BitVec64
- thaw :: BitVec64 -> ST s (MBitVec64 s)
- unsafeRemWord64 :: Word64 -> Word64 -> Word64
Documentation
Bit vector backed up by an array of Word64
This vector's offset and length are multiples of 64
new :: Word64 -> ST s (MBitVec64 s) Source #
Will create an explicitly pinned byte array if it is larger than 1 kB.
This is done because pinned byte arrays allow for more efficient
serialisation, but the definition of isByteArrayPinned
changed in GHC 9.6,
see https://gitlab.haskell.org/ghc/ghc/-/issues/22255.
TODO: remove this workaround once a solution exists, e.g. a new primop that allows checking for implicit pinning.