Copyright | (c) Hideyuki Tanaka 2009-2015 |
---|---|
License | BSD3 |
Maintainer | tanaka.hideyuki@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Simple interface to pack and unpack MessagePack data.
Synopsis
- pack :: MessagePack a => a -> ByteString
- unpack :: (Applicative m, Monad m, MessagePack a) => ByteString -> m 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) -> [a] -> Put
- putMap :: (a -> Put) -> (b -> Put) -> [(a, b)] -> Put
- putExt :: Word8 -> ByteString -> Put
- getObject :: Get Object
- getNil :: Get ()
- getBool :: Get Bool
- getInt :: Get Int64
- getWord :: Get Word64
- getFloat :: Get Float
- getDouble :: Get Double
- getStr :: Get Text
- getBin :: Get ByteString
- getArray :: Get a -> Get [a]
- getMap :: Get a -> Get b -> Get [(a, b)]
- getExt :: Get (Word8, ByteString)
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, 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.
Re-export modules
module Data.MessagePack.Types
putBin :: ByteString -> Put Source #
getBin :: Get ByteString Source #