Safe Haskell | None |
---|---|
Language | Haskell2010 |
Put monad
FIXME: PutM uses slow ByteString builder... We need to replace it with a fast one
Synopsis
- type Put = PutM ()
- data PutM a
- runPut :: Put -> Buffer
- runPutM :: PutM a -> (a, Buffer)
- putBuffer :: Buffer -> Put
- putByteString :: ByteString -> Put
- putPadding :: Word -> Put
- putPaddingAlign :: Word -> Word -> Put
- putWord8 :: Word8 -> Put
- putWord16le :: Word16 -> Put
- putWord16be :: Word16 -> Put
- putWord32le :: Word32 -> Put
- putWord32be :: Word32 -> Put
- putWord64le :: Word64 -> Put
- putWord64be :: Word64 -> Put
Documentation
The PutM type. A Writer monad over the efficient Builder monoid.
Put
putByteString :: ByteString -> Put Source #
Put a ByteString
putPadding :: Word -> Put Source #
Put null bytes
putPaddingAlign :: Word -> Word -> Put Source #
Put null bytes to align the given value to the second
putWord16le :: Word16 -> Put Source #
Put a Word16 little-endian
putWord16be :: Word16 -> Put Source #
Put a Word16 big-endian
putWord32le :: Word32 -> Put Source #
Put a Word32 little-endian
putWord32be :: Word32 -> Put Source #
Put a Word32 big-endian
putWord64le :: Word64 -> Put Source #
Put a Word64 little-endian
putWord64be :: Word64 -> Put Source #
Put a Word64 big-endian