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

Copyright(c) Lennart Kolmodin 2010-2011
LicenseBSD3-style (see LICENSE)
Maintainerkolmodin@gmail.com
Stabilityexperimental
Portabilityportable (should run where the package binary runs)
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.Binary.Bits.Put

Contents

Description

Put bits easily.

Synopsis

Documentation

runBitPut :: BitPut () -> Put Source

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