-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Sharing code for serialization between binary and cereal
--
-- Sharing code for serialization between binary and cereal
@package bytes
@version 0.1
-- | This module generalizes the binary PutM and
-- cereal PutM monads in an ad hoc fashion to permit code
-- to be written that is compatible across them.
--
-- Moreover, this class permits code to be written to be portable over
-- various monad transformers applied to these as base monads.
module Data.Bytes.Put
class Monad m => MonadPut m where putWord8 = lift . putWord8 putByteString = lift . putByteString putLazyByteString = lift . putLazyByteString flush = lift flush putWord16le = lift . putWord16le putWord16be = lift . putWord16be putWord16host = lift . putWord16host putWord32le = lift . putWord32le putWord32be = lift . putWord32be putWord32host = lift . putWord32host putWord64le = lift . putWord64le putWord64be = lift . putWord64be putWord64host = lift . putWord64host putWordhost = lift . putWordhost
putWord8 :: MonadPut m => Word8 -> m ()
putByteString :: MonadPut m => ByteString -> m ()
putLazyByteString :: MonadPut m => ByteString -> m ()
flush :: MonadPut m => m ()
putWord16le :: MonadPut m => Word16 -> m ()
putWord16be :: MonadPut m => Word16 -> m ()
putWord16host :: MonadPut m => Word16 -> m ()
putWord32le :: MonadPut m => Word32 -> m ()
putWord32be :: MonadPut m => Word32 -> m ()
putWord32host :: MonadPut m => Word32 -> m ()
putWord64le :: MonadPut m => Word64 -> m ()
putWord64be :: MonadPut m => Word64 -> m ()
putWord64host :: MonadPut m => Word64 -> m ()
putWordhost :: MonadPut m => Word -> m ()
instance (MonadPut m, Monoid w) => MonadPut (RWST r w s m)
instance (MonadPut m, Monoid w) => MonadPut (RWST r w s m)
instance (MonadPut m, Monoid w) => MonadPut (WriterT w m)
instance (MonadPut m, Monoid w) => MonadPut (WriterT w m)
instance MonadPut m => MonadPut (ReaderT e m)
instance MonadPut m => MonadPut (StateT s m)
instance MonadPut m => MonadPut (StateT s m)
instance MonadPut PutM
instance MonadPut PutM
-- | This module generalizes the binary Get and
-- cereal Get monads in an ad hoc fashion to permit code
-- to be written that is compatible across them.
--
-- Moreover, this class permits code to be written to be portable over
-- various monad transformers applied to these as base monads.
module Data.Bytes.Get
class (Integral (Unchecked m), Monad m) => MonadGet m where type family Unchecked m :: * type family Bytes m :: * skip = lift . skip uncheckedSkip = lift . uncheckedSkip uncheckedLookAhead = lift . uncheckedLookAhead getBytes = lift . getBytes remaining = lift remaining isEmpty = lift isEmpty getWord8 = lift getWord8 getByteString = lift . getByteString getLazyByteString = lift . getLazyByteString getWord16be = lift getWord16be getWord16le = lift getWord16le getWord16host = lift getWord16host getWord32be = lift getWord32be getWord32le = lift getWord32le getWord32host = lift getWord32host getWord64be = lift getWord64be getWord64le = lift getWord64le getWord64host = lift getWord64host getWordhost = lift getWordhost
skip :: MonadGet m => Int -> m ()
uncheckedSkip :: MonadGet m => Unchecked m -> m ()
lookAhead :: MonadGet m => m a -> m a
lookAheadM :: MonadGet m => m (Maybe a) -> m (Maybe a)
lookAheadE :: MonadGet m => m (Either a b) -> m (Either a b)
uncheckedLookAhead :: MonadGet m => Unchecked m -> m (Bytes m)
getBytes :: MonadGet m => Int -> m ByteString
remaining :: MonadGet m => m (Unchecked m)
isEmpty :: MonadGet m => m Bool
getWord8 :: MonadGet m => m Word8
getByteString :: MonadGet m => Int -> m ByteString
getLazyByteString :: MonadGet m => Int64 -> m ByteString
getWord16be :: MonadGet m => m Word16
getWord16le :: MonadGet m => m Word16
getWord16host :: MonadGet m => m Word16
getWord32be :: MonadGet m => m Word32
getWord32le :: MonadGet m => m Word32
getWord32host :: MonadGet m => m Word32
getWord64be :: MonadGet m => m Word64
getWord64le :: MonadGet m => m Word64
getWord64host :: MonadGet m => m Word64
getWordhost :: MonadGet m => m Word
instance (MonadGet m, Monoid w) => MonadGet (RWST r w s m)
instance (MonadGet m, Monoid w) => MonadGet (RWST r w s m)
instance (MonadGet m, Monoid w) => MonadGet (WriterT w m)
instance (MonadGet m, Monoid w) => MonadGet (WriterT w m)
instance MonadGet m => MonadGet (ReaderT e m)
instance MonadGet m => MonadGet (StateT s m)
instance MonadGet m => MonadGet (StateT s m)
instance MonadGet Get
instance MonadGet Get