haskus-binary-1.5: Haskus binary format manipulation

Safe HaskellNone
LanguageHaskell2010

Haskus.Binary.Bits.Finite

Description

Types with finite bit count

Synopsis

Documentation

class FiniteBits a where Source #

Type representable by a fixed amount of bits

Associated Types

type BitSize a :: Nat Source #

Number of bits

Methods

bitSize :: (Integral i, KnownNat (BitSize a)) => a -> i Source #

Number of bits (the value is ignored)

zeroBits :: a Source #

All bits set to 0

oneBits :: a Source #

All bits set to 1

countLeadingZeros :: a -> Word Source #

Count number of zero bits preceding the most significant set bit

countTrailingZeros :: a -> Word Source #

Count number of zero bits following the least significant set bit

complement :: a -> a Source #

Complement

Instances
FiniteBits Int Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Int :: Nat Source #

FiniteBits Int8 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Int8 :: Nat Source #

FiniteBits Int16 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Int16 :: Nat Source #

FiniteBits Int32 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Int32 :: Nat Source #

FiniteBits Int64 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Int64 :: Nat Source #

FiniteBits Word Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Word :: Nat Source #

FiniteBits Word8 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Word8 :: Nat Source #

FiniteBits Word16 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Word16 :: Nat Source #

FiniteBits Word32 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Word32 :: Nat Source #

FiniteBits Word64 Source # 
Instance details

Defined in Haskus.Binary.Bits.Finite

Associated Types

type BitSize Word64 :: Nat Source #

FiniteBits a => FiniteBits (AsLittleEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Associated Types

type BitSize (AsLittleEndian a) :: Nat Source #

FiniteBits a => FiniteBits (AsBigEndian a) Source # 
Instance details

Defined in Haskus.Binary.Endianness

Associated Types

type BitSize (AsBigEndian a) :: Nat Source #

(KnownNat (BitSize a), FiniteBits a, KnownNat n, Storable a) => FiniteBits (Vector n a) Source # 
Instance details

Defined in Haskus.Binary.Vector

Associated Types

type BitSize (Vector n a) :: Nat Source #