 | binary-0.2: Binary serialization using lazy ByteStrings | Contents | Index |
|
Data.Binary.Put | Portability | Portable to Hugs and GHC. Requires MPTCs | Stability | stable | Maintainer | Lennart Kolmodin <[email protected]> |
|
|
|
|
|
Description |
The Put monad. A monad for efficiently constructing lazy bytestrings.
|
|
Synopsis |
|
|
|
|
The Put type
|
|
type Put = PutM () |
|
runPut :: Put -> ByteString |
Run the Put monad with a serialiser
|
|
Flushing the implicit parse state
|
|
flush :: Put |
Pop the ByteString we have constructed so far, if any, yielding a
new chunk in the result ByteString.
|
|
Primitives
|
|
putWord8 :: Word8 -> Put |
Efficiently write a byte into the output buffer
|
|
putByteString :: ByteString -> Put |
An efficient primitive to write a strict ByteString into the output buffer.
It flushes the current buffer, and writes the argument into a new chunk.
|
|
putLazyByteString :: ByteString -> Put |
Write a lazy ByteString efficiently, simply appending the lazy
ByteString chunks to the output buffer
|
|
Big-endian primitives
|
|
putWord16be :: Word16 -> Put |
Write a Word16 in big endian format
|
|
putWord32be :: Word32 -> Put |
Write a Word32 in big endian format
|
|
putWord64be :: Word64 -> Put |
Write a Word64 in big endian format
|
|
Little-endian primitives
|
|
putWord16le :: Word16 -> Put |
Write a Word16 in little endian format
|
|
putWord32le :: Word32 -> Put |
Write a Word32 in little endian format
|
|
putWord64le :: Word64 -> Put |
Write a Word64 in little endian format
|
|
Produced by Haddock version 0.8 |