Safe Haskell | None |
---|---|
Language | Haskell2010 |
- encode :: (Serialize a, Monad m) => a -> Producer' ByteString m ()
- encodePut :: Monad m => Put -> Producer' ByteString m ()
- decode :: (Serialize a, Monad m) => Parser ByteString m (Either String a)
- decodeGet :: Monad m => Get a -> Parser ByteString m (Either String a)
- type Put = PutM ()
- data Get a :: * -> *
- class Serialize t
Documentation
encode :: (Serialize a, Monad m) => a -> Producer' ByteString m () Source
Encode a value to a byte stream.
decode :: (Serialize a, Monad m) => Parser ByteString m (Either String a) Source
Decode a value from a byte stream.
decodeGet :: Monad m => Get a -> Parser ByteString m (Either String a) Source
Decode a value using an explicit Get
.
data Get a :: * -> *
The Get monad is an Exception and State monad.
class Serialize t
If your compiler has support for the DeriveGeneric
and
DefaultSignatures
language extensions (ghc >= 7.2.1
), the put
and get
methods will have default generic implementations.
To use this option, simply add a deriving
clause to your datatype
and declare a Generic
Serialize
instance for it without giving a definition for
put
and get
.