Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.BitArray
Description
Immutable one-dimensional packed bit arrays. The main advantage should be compactness in memory.
Synopsis
- data BitArray
- bitArrayBounds :: BitArray -> (Int, Int)
- lookupBit :: BitArray -> Int -> Bool
- unsafeLookupBit :: BitArray -> Int -> Bool
- bitArray :: (Int, Int) -> [(Int, Bool)] -> BitArray
- bitArray' :: Bool -> (Int, Int) -> [(Int, Bool)] -> BitArray
- accumBitArray :: (Bool -> a -> Bool) -> Bool -> (Int, Int) -> [(Int, a)] -> BitArray
- listBitArray :: (Int, Int) -> [Bool] -> BitArray
- bits :: BitArray -> [Bool]
- bits01 :: BitArray -> [Int]
- listBitArray01 :: (Int, Int) -> [Int] -> BitArray
Documentation
A packed bit array.
Internally, it is represented as an unboxed array of Word64
-s.
Bit array construction / deconstruction
bitArray' :: Bool -> (Int, Int) -> [(Int, Bool)] -> BitArray Source #
The first argument gives the default value (instead of False
)
listBitArray :: (Int, Int) -> [Bool] -> BitArray Source #
If the list is too short, the rest of the array is filled with False
.