bv-little-1.3.1: Efficient little-endian bit vector library
Copyright© 2020 Alex Washburn
LicenseBSD-3-Clause
Maintainergithub@recursion.ninja
StabilityStable
Safe HaskellSafe
LanguageGHC2021

Data.BitVector.LittleEndian

Description

A bit vector similar to Data.BitVector from the bv, however the endianness is reversed. This module defines little-endian pseudo–size-polymorphic bit vectors.

Little-endian bit vectors are isomorphic to a [Bool] with the least significant bit at the head of the list and the most significant bit at the end of the list. Consequently, the endianness of a bit vector affects the semantics of many type-classes that have a linear ordering.

For an implementation of bit vectors which are isomorphic to a [Bool] with the most significant bit at the head of the list and the least significant bit at the end of the list, use the bv package.

This module does not define numeric instances for BitVector. This is intentional! To interact with a bit vector as an Integral value, convert the BitVector using either toSignedNumber or toUnsignedNumber.

This module defines rank and select operations for BitVector as a succinct data structure. These operations are not o(1) so BitVector is not a true succinct data structure. However, it could potentially be extend to support this in the future.

Synopsis

Documentation

data BitVector #

Instances

Instances details
Data BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BitVector -> c BitVector #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BitVector #

toConstr :: BitVector -> Constr #

dataTypeOf :: BitVector -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BitVector) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BitVector) #

gmapT :: (forall b. Data b => b -> b) -> BitVector -> BitVector #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BitVector -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BitVector -> r #

gmapQ :: (forall d. Data d => d -> u) -> BitVector -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BitVector -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BitVector -> m BitVector #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BitVector -> m BitVector #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BitVector -> m BitVector #

Monoid BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Semigroup BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Bits BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

FiniteBits BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Generic BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Associated Types

type Rep BitVector :: Type -> Type #

Read BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Show BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

NFData BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Methods

rnf :: BitVector -> () #

Eq BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Ord BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

Hashable BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

type Rep BitVector 
Instance details

Defined in Data.BitVector.LittleEndian.Internal

type Rep BitVector = D1 ('MetaData "BitVector" "Data.BitVector.LittleEndian.Internal" "bv-little-1.3.1-inplace-core" 'False) (C1 ('MetaCons "BV" 'PrefixI 'True) (S1 ('MetaSel ('Just "dim") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word) :*: S1 ('MetaSel ('Just "nat") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)))

Bit-stream conversion

Numeric conversion

Queries

Rank / Select