bitarray-0.0.1: Mutable and immutable bit arrays

Data.BitArray

Contents

Description

Immutable one-dimensional packed bit arrays. The main advantage should be compactness in memory.

Synopsis

Documentation

data BitArray Source

A packed bit array. Internally, it is represented as an unboxed array of Word64-s.

Bit array construction / deconstruction

bitArray :: (Int, Int) -> [(Int, Bool)] -> BitArraySource

Unspecified values become False.

bitArray' :: Bool -> (Int, Int) -> [(Int, Bool)] -> BitArraySource

The first argument gives the default value (instead of False)

accumBitArray :: (Bool -> a -> Bool) -> Bool -> (Int, Int) -> [(Int, a)] -> BitArraySource

listBitArray :: (Int, Int) -> [Bool] -> BitArraySource

If the list is too short, the rest of the array is filled with False.

0/1 versions