binary-bits-0.3: Bit parsing/writing on top of binary.

Portabilityportable (should run where the package binary runs)
Stabilityexperimental
Maintainerkolmodin@gmail.com
Safe HaskellSafe-Inferred

Data.Binary.Bits.Put

Contents

Description

Put bits easily.

Synopsis

Documentation

data BitPut a Source

Instances

runBitPut :: BitPut () -> PutSource

Run the BitPut monad inside Put.

joinPut :: Put -> BitPut ()Source

Run a Put inside BitPut. Any partially written bytes will be flushed before Put executes to ensure byte alignment.

Data types

Bool

putBool :: Bool -> BitPut ()Source

Put a 1 bit Bool.

Words

putWord8 :: Int -> Word8 -> BitPut ()Source

Put the n lower bits of a Word8.

putWord16be :: Int -> Word16 -> BitPut ()Source

Put the n lower bits of a Word16.

putWord32be :: Int -> Word32 -> BitPut ()Source

Put the n lower bits of a Word32.

putWord64be :: Int -> Word64 -> BitPut ()Source

Put the n lower bits of a Word64.

ByteString