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
LanguageHaskell98

Data.Binary.Bits.Put

Description

Put bits easily.

Synopsis

Documentation

data BitPut a Source #

Instances

Instances details
Monad BitPut Source # 
Instance details

Defined in Data.Binary.Bits.Put

Methods

(>>=) :: BitPut a -> (a -> BitPut b) -> BitPut b

(>>) :: BitPut a -> BitPut b -> BitPut b

return :: a -> BitPut a

Functor BitPut Source # 
Instance details

Defined in Data.Binary.Bits.Put

Methods

fmap :: (a -> b) -> BitPut a -> BitPut b

(<$) :: a -> BitPut b -> BitPut a

Applicative BitPut Source # 
Instance details

Defined in Data.Binary.Bits.Put

Methods

pure :: a -> BitPut a

(<*>) :: BitPut (a -> b) -> BitPut a -> BitPut b

liftA2 :: (a -> b -> c) -> BitPut a -> BitPut b -> BitPut c

(*>) :: BitPut a -> BitPut b -> BitPut b

(<*) :: BitPut a -> BitPut b -> BitPut a

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

putByteString :: ByteString -> BitPut () Source #

Put a ByteString.