msgpack-1.0.1.0: A Haskell implementation of MessagePack

Copyright© Hideyuki Tanaka 2009-2015
© Herbert Valerio Riedel 2019
LicenseBSD3
Safe HaskellTrustworthy
LanguageHaskell2010

Data.MessagePack.Object

Contents

Description

MessagePack object definition

Synopsis

MessagePack Object

data Object Source #

Object Representation of MessagePack data.

Constructors

ObjectNil

represents nil

ObjectBool !Bool

represents true or false

ObjectInt !Int

represents an integer

ObjectFloat !Float

represents a floating point number

ObjectDouble !Double

represents a floating point number

ObjectStr !Text

extending Raw type represents a UTF-8 string

ObjectBin !ByteString

extending Raw type represents a byte array

ObjectArray !(Vector Object)

represents a sequence of objects

ObjectMap !(Vector (Object, Object))

represents key-value pairs of objects

ObjectExt !Word8 !ByteString

represents a tuple of an integer and a byte array where the integer represents type information and the byte array represents data.

Instances
Eq Object Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

(==) :: Object -> Object -> Bool #

(/=) :: Object -> Object -> Bool #

Ord Object Source # 
Instance details

Defined in Data.MessagePack.Object

Read Object Source # 
Instance details

Defined in Data.MessagePack.Object

Show Object Source # 
Instance details

Defined in Data.MessagePack.Object

Generic Object Source # 
Instance details

Defined in Data.MessagePack.Object

Associated Types

type Rep Object :: Type -> Type #

Methods

from :: Object -> Rep Object x #

to :: Rep Object x -> Object #

Binary Object Source #

This Binary instance encodes/decodes to/from MessagePack format

Instance details

Defined in Data.MessagePack.Object

Methods

put :: Object -> Put #

get :: Get Object #

putList :: [Object] -> Put #

NFData Object Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

rnf :: Object -> () #

MessagePack Object Source #

The trivial identity MessagePack instance

Instance details

Defined in Data.MessagePack.Object

type Rep Object Source # 
Instance details

Defined in Data.MessagePack.Object

type Rep Object = D1 (MetaData "Object" "Data.MessagePack.Object" "msgpack-1.0.1.0-FFuxLougBOQFoaFBQgMluD" False) (((C1 (MetaCons "ObjectNil" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ObjectBool" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool))) :+: (C1 (MetaCons "ObjectInt" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 Int)) :+: (C1 (MetaCons "ObjectFloat" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 Float)) :+: C1 (MetaCons "ObjectDouble" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 Double))))) :+: ((C1 (MetaCons "ObjectStr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) :+: C1 (MetaCons "ObjectBin" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString))) :+: (C1 (MetaCons "ObjectArray" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Vector Object))) :+: (C1 (MetaCons "ObjectMap" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Vector (Object, Object)))) :+: C1 (MetaCons "ObjectExt" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) SourceUnpack SourceStrict DecidedStrict) (Rec0 Word8) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ByteString))))))

MessagePack Serializable Types

class MessagePack a where Source #

Class for converting between MessagePack Objects and native Haskell types.

Instances
MessagePack Bool Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack Double Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack Float Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack Int Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack () Source #

Encodes as ObjectNil

Instance details

Defined in Data.MessagePack.Object

MessagePack String Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack ShortByteString Source #

Since: 1.0.1.0

Instance details

Defined in Data.MessagePack.Object

MessagePack ByteString Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack ByteString Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack Text Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack Text Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack Object Source #

The trivial identity MessagePack instance

Instance details

Defined in Data.MessagePack.Object

MessagePack a => MessagePack [a] Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: [a] -> Object Source #

fromObject :: Object -> Maybe [a] Source #

MessagePack a => MessagePack (Maybe a) Source #

Maybes are encoded as nullable types, i.e. Nothing is encoded as nil.

NOTE: Encoding nested Maybes or Maybes enclosing types which encode to nil (such as '()') will break round-tripping

Instance details

Defined in Data.MessagePack.Object

MessagePack v => MessagePack (IntMap v) Source # 
Instance details

Defined in Data.MessagePack.Object

MessagePack a => MessagePack (Vector a) Source # 
Instance details

Defined in Data.MessagePack.Object

(MessagePack k, MessagePack v) => MessagePack (Assoc [(k, v)]) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: Assoc [(k, v)] -> Object Source #

fromObject :: Object -> Maybe (Assoc [(k, v)]) Source #

(MessagePack a, MessagePack b) => MessagePack (Assoc (Vector (a, b))) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: Assoc (Vector (a, b)) -> Object Source #

fromObject :: Object -> Maybe (Assoc (Vector (a, b))) Source #

(MessagePack a1, MessagePack a2) => MessagePack (a1, a2) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2) -> Object Source #

fromObject :: Object -> Maybe (a1, a2) Source #

(MessagePack k, MessagePack v, Ord k) => MessagePack (Map k v) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: Map k v -> Object Source #

fromObject :: Object -> Maybe (Map k v) Source #

(MessagePack k, MessagePack v, Hashable k, Eq k) => MessagePack (HashMap k v) Source # 
Instance details

Defined in Data.MessagePack.Object

(MessagePack a1, MessagePack a2, MessagePack a3) => MessagePack (a1, a2, a3) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3) Source #

(MessagePack a1, MessagePack a2, MessagePack a3, MessagePack a4) => MessagePack (a1, a2, a3, a4) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3, a4) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3, a4) Source #

(MessagePack a1, MessagePack a2, MessagePack a3, MessagePack a4, MessagePack a5) => MessagePack (a1, a2, a3, a4, a5) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3, a4, a5) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3, a4, a5) Source #

(MessagePack a1, MessagePack a2, MessagePack a3, MessagePack a4, MessagePack a5, MessagePack a6) => MessagePack (a1, a2, a3, a4, a5, a6) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3, a4, a5, a6) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3, a4, a5, a6) Source #

(MessagePack a1, MessagePack a2, MessagePack a3, MessagePack a4, MessagePack a5, MessagePack a6, MessagePack a7) => MessagePack (a1, a2, a3, a4, a5, a6, a7) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3, a4, a5, a6, a7) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3, a4, a5, a6, a7) Source #

(MessagePack a1, MessagePack a2, MessagePack a3, MessagePack a4, MessagePack a5, MessagePack a6, MessagePack a7, MessagePack a8) => MessagePack (a1, a2, a3, a4, a5, a6, a7, a8) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3, a4, a5, a6, a7, a8) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8) Source #

(MessagePack a1, MessagePack a2, MessagePack a3, MessagePack a4, MessagePack a5, MessagePack a6, MessagePack a7, MessagePack a8, MessagePack a9) => MessagePack (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source # 
Instance details

Defined in Data.MessagePack.Object

Methods

toObject :: (a1, a2, a3, a4, a5, a6, a7, a8, a9) -> Object Source #

fromObject :: Object -> Maybe (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source #