msgpack-testsuite-0.0.16: A Haskell implementation of MessagePack
Safe HaskellTrustworthy
LanguageHaskell2010

Test.MessagePack.BytePacker

Synopsis

Documentation

class BytePacker p where Source #

Methods

pack :: MessagePack a => p -> a -> ByteString Source #

Pack a Haskell value to MessagePack binary.

unpackValidate :: MessagePack a => p -> ByteString -> Validate DecodeError a Source #

Unpack MessagePack binary to a Haskell value.

On failure, returns a list of error messages.

unpack :: (BytePacker p, Monad m, MonadFail m, MessagePack a) => p -> ByteString -> m a Source #

Unpack MessagePack binary to a Haskell value. If it fails, it fails in the Monad. In the Maybe monad, failure returns Nothing.