haskus-binary-1.5: Haskus binary format manipulation

Safe HaskellNone
LanguageHaskell2010

Haskus.Binary.Put

Contents

Description

Put monad

FIXME: PutM uses slow ByteString builder... We need to replace it with a fast one

Synopsis

Documentation

type Put = PutM () #

Put merely lifts Builder into a Writer monad, applied to ().

data PutM a #

The PutM type. A Writer monad over the efficient Builder monoid.

Instances
Monad PutM 
Instance details

Defined in Data.Serialize.Put

Methods

(>>=) :: PutM a -> (a -> PutM b) -> PutM b #

(>>) :: PutM a -> PutM b -> PutM b #

return :: a -> PutM a #

fail :: String -> PutM a #

Functor PutM 
Instance details

Defined in Data.Serialize.Put

Methods

fmap :: (a -> b) -> PutM a -> PutM b #

(<$) :: a -> PutM b -> PutM a #

Applicative PutM 
Instance details

Defined in Data.Serialize.Put

Methods

pure :: a -> PutM a #

(<*>) :: PutM (a -> b) -> PutM a -> PutM b #

liftA2 :: (a -> b -> c) -> PutM a -> PutM b -> PutM c #

(*>) :: PutM a -> PutM b -> PutM b #

(<*) :: PutM a -> PutM b -> PutM a #

Semigroup (PutM ()) 
Instance details

Defined in Data.Serialize.Put

Methods

(<>) :: PutM () -> PutM () -> PutM () #

sconcat :: NonEmpty (PutM ()) -> PutM () #

stimes :: Integral b => b -> PutM () -> PutM () #

Monoid (PutM ()) 
Instance details

Defined in Data.Serialize.Put

Methods

mempty :: PutM () #

mappend :: PutM () -> PutM () -> PutM () #

mconcat :: [PutM ()] -> PutM () #

runPut :: Put -> Buffer Source #

Execute Put

runPutM :: PutM a -> (a, Buffer) Source #

Execute PutM

Put

putBuffer :: Buffer -> Put Source #

Put a buffer

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

putWord8 :: Word8 -> Put Source #

Put a Word8

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