flat-0.3: Principled and efficient bit-oriented binary serialization.

Safe HaskellNone
LanguageHaskell2010

Data.Flat.Bits

Contents

Description

Utilities to represent and display bit sequences

Synopsis

Documentation

type Bits = Vector Bool #

A sequence of bits

toBools :: Bits -> [Bool] #

bits :: forall a. Flat a => a -> Bits #

The sequence of bits corresponding to the serialization of the passed value (without any final byte padding)

paddedBits :: forall a. Flat a => a -> Bits #

The sequence of bits corresponding to the byte-padded serialization of the passed value

asBytes :: Bits -> [Word8] #

Convert a sequence of bits to the corresponding list of bytes

asBits :: FiniteBits a => a -> Bits #

asBits (5::Word8) | > [False,False,False,False,False,True,False,True]

Orphan instances