-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Simple bit vectors for Haskell -- @package bit-vector @version 0.2.0 module Data.Vector.Bit -- | A BitVector is a little-endian Vector of Bools. type BitVector = Vector Bool -- | Converts an instance of FiniteBits to a BitVector. unpack :: FiniteBits a => a -> BitVector -- | Converts a BitVector to an instance of Bits. pack :: (Num a, Bits a) => BitVector -> a unpackInteger :: Integer -> BitVector packInteger :: BitVector -> Integer unpackInt :: Int -> BitVector packInt :: BitVector -> Int -- | Pads a BitVector to the specified length by adding a vector of -- False values to the most-significant end. pad :: Int -> BitVector -> BitVector -- | Pads two BitVectors to the length of the longest vector. If the -- vectors are the same length, padMax does nothing. padMax :: BitVector -> BitVector -> (BitVector, BitVector) -- | Like zip, except pads the vectors to equal length rather than -- discarding elements of the longer vector. zipPad :: BitVector -> BitVector -> Vector (Bool, Bool) -- | Discards any False values at the most-significant end of the -- given BitVector. trimLeading :: BitVector -> BitVector -- | Equality modulo trailing False bits (==~) :: BitVector -> BitVector -> Bool instance FiniteBits BitVector instance Bits BitVector instance Num BitVector