-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A Haskell binding to MessagePack -- -- A Haskell binding to MessagePack http://msgpack.sourceforge.jp/ @package msgpack @version 0.3.0 -- | MessagePack object definition module Data.MessagePack.Object -- | Object Representation of MessagePack data. data Object ObjectNil :: Object ObjectBool :: Bool -> Object ObjectInteger :: Int -> Object ObjectDouble :: Double -> Object ObjectRAW :: ByteString -> Object ObjectArray :: [Object] -> Object ObjectMap :: [(Object, Object)] -> Object -- | The class of types serializable to and from MessagePack object class OBJECT a toObject :: (OBJECT a) => a -> Object fromObject :: (OBJECT a) => Object -> Result a -- | A type for parser results type Result a = Either String a instance Show Object instance (OBJECT a) => OBJECT (Maybe a) instance (OBJECT a, OBJECT b) => OBJECT [(a, b)] instance (OBJECT a) => OBJECT [a] instance OBJECT String instance OBJECT ByteString instance OBJECT Double instance OBJECT Bool instance OBJECT Int instance OBJECT () instance OBJECT Object -- | MessagePack Serializer using Data.Binary.Put module Data.MessagePack.Put -- | Serializable class class ObjectPut a put :: (ObjectPut a) => a -> Put instance [incoherent] (ObjectPut k, ObjectPut v) => ObjectPut (Vector (k, v)) instance [incoherent] (ObjectPut k, ObjectPut v) => ObjectPut [(k, v)] instance [incoherent] (ObjectPut a) => ObjectPut (Vector a) instance [incoherent] (ObjectPut a) => ObjectPut [a] instance [incoherent] ObjectPut ByteString instance [incoherent] ObjectPut Double instance [incoherent] ObjectPut Bool instance [incoherent] ObjectPut () instance [incoherent] ObjectPut Int instance [incoherent] ObjectPut Object -- | MessagePack Deserializer using Data.Attoparsec module Data.MessagePack.Parser -- | Deserializable class class ObjectGet a get :: (ObjectGet a) => Parser a instance [incoherent] ObjectGet Object instance [incoherent] (ObjectGet k, ObjectGet v) => ObjectGet (Vector (k, v)) instance [incoherent] (ObjectGet k, ObjectGet v) => ObjectGet [(k, v)] instance [incoherent] (ObjectGet a) => ObjectGet (Vector a) instance [incoherent] (ObjectGet a) => ObjectGet [a] instance [incoherent] ObjectGet ByteString instance [incoherent] ObjectGet Double instance [incoherent] ObjectGet Bool instance [incoherent] ObjectGet () instance [incoherent] ObjectGet Int -- | Simple interface to pack and unpack MessagePack data. module Data.MessagePack -- | Pack Haskell data to MessagePack string. pack :: (ObjectPut a) => a -> ByteString -- | Unpack MessagePack string to Haskell data. unpack :: (ObjectGet a, IsByteString s) => s -> a -- | Pack to ByteString. packToString :: Put -> ByteString -- | Pack to Handle packToHandle :: Handle -> Put -> IO () -- | Pack to File packToFile :: FilePath -> Put -> IO () -- | Unpack from ByteString unpackFromString :: (Monad m, IsByteString s) => s -> Parser a -> m a -- | Unpack from Handle unpackFromHandle :: (MonadCatchIO m) => Handle -> Parser a -> m a -- | Unpack from File unpackFromFile :: (MonadCatchIO m) => FilePath -> Parser a -> m a instance IsByteString ByteString instance IsByteString ByteString