Copyright | (c) Hideyuki Tanaka 2009-2015 |
---|---|
License | BSD3 |
Maintainer | tanaka.hideyuki@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Simple interface to pack and unpack MessagePack data.
Synopsis
- pack :: MessagePack a => a -> ByteString
- unpack :: (Applicative m, Monad m, MonadFail m, MessagePack a) => ByteString -> m a
- unpackEither :: MessagePack a => ByteString -> Either DecodeError a
- unpackValidate :: MessagePack a => ByteString -> Validate DecodeError a
- module Data.MessagePack.Types
- putObject :: Object -> Put
- putNil :: Put
- putBool :: Bool -> Put
- putInt :: Int64 -> Put
- putWord :: Word64 -> Put
- putFloat :: Float -> Put
- putDouble :: Double -> Put
- putStr :: Text -> Put
- putBin :: ByteString -> Put
- putArray :: (a -> Put) -> Vector a -> Put
- putMap :: (a -> Put) -> (b -> Put) -> Vector (a, b) -> Put
- putExt :: Word8 -> ByteString -> Put
- getObject :: Get Object
Simple interface to pack and unpack msgpack binary
pack :: MessagePack a => a -> ByteString Source #
Pack a Haskell value to MessagePack binary.
unpack :: (Applicative m, Monad m, MonadFail m, MessagePack a) => 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.
unpackEither :: MessagePack a => ByteString -> Either DecodeError a Source #
unpackValidate :: MessagePack a => ByteString -> Validate DecodeError a Source #
Unpack MessagePack binary to a Haskell value.
On failure, returns a list of error messages.
Re-export modules
module Data.MessagePack.Types
putBin :: ByteString -> Put Source #