msgpack-types-0.2.1: A Haskell implementation of MessagePack.
Safe HaskellTrustworthy
LanguageHaskell2010

Data.MessagePack.Types

Synopsis

Documentation

newtype Assoc a Source #

Constructors

Assoc 

Fields

Instances

Instances details
Eq a => Eq (Assoc a) Source # 
Instance details

Defined in Data.MessagePack.Types.Assoc

Methods

(==) :: Assoc a -> Assoc a -> Bool #

(/=) :: Assoc a -> Assoc a -> Bool #

Ord a => Ord (Assoc a) Source # 
Instance details

Defined in Data.MessagePack.Types.Assoc

Methods

compare :: Assoc a -> Assoc a -> Ordering #

(<) :: Assoc a -> Assoc a -> Bool #

(<=) :: Assoc a -> Assoc a -> Bool #

(>) :: Assoc a -> Assoc a -> Bool #

(>=) :: Assoc a -> Assoc a -> Bool #

max :: Assoc a -> Assoc a -> Assoc a #

min :: Assoc a -> Assoc a -> Assoc a #

Read a => Read (Assoc a) Source # 
Instance details

Defined in Data.MessagePack.Types.Assoc

Show a => Show (Assoc a) Source # 
Instance details

Defined in Data.MessagePack.Types.Assoc

Methods

showsPrec :: Int -> Assoc a -> ShowS #

show :: Assoc a -> String #

showList :: [Assoc a] -> ShowS #

Arbitrary a => Arbitrary (Assoc a) Source # 
Instance details

Defined in Data.MessagePack.Types.Assoc

Methods

arbitrary :: Gen (Assoc a) #

shrink :: Assoc a -> [Assoc a] #

NFData a => NFData (Assoc a) Source # 
Instance details

Defined in Data.MessagePack.Types.Assoc

Methods

rnf :: Assoc a -> () #

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

Defined in Data.MessagePack.Types.Class

Methods

toObject :: Config -> Assoc [(a, b)] -> Object Source #

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (Assoc [(a, b)]) Source #

data Object Source #

Object Representation of MessagePack data.

Constructors

ObjectNil

represents nil

ObjectBool Bool

represents true or false

ObjectInt Int64

represents a negative integer

ObjectWord Word64

represents a positive 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 [Object]

represents a sequence of objects

ObjectMap [(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

Instances details
Eq Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

Methods

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

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

Ord Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

Read Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

Show Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

Generic Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

Associated Types

type Rep Object :: Type -> Type #

Methods

from :: Object -> Rep Object x #

to :: Rep Object x -> Object #

Arbitrary Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

NFData Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

Methods

rnf :: Object -> () #

MessagePack Object Source # 
Instance details

Defined in Data.MessagePack.Types.Class

type Rep Object Source # 
Instance details

Defined in Data.MessagePack.Types.Object

type Rep Object = D1 ('MetaData "Object" "Data.MessagePack.Types.Object" "msgpack-types-0.2.1-inplace" 'False) (((C1 ('MetaCons "ObjectNil" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ObjectBool" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :+: (C1 ('MetaCons "ObjectInt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Int64)) :+: (C1 ('MetaCons "ObjectWord" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "ObjectFloat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Float))))) :+: ((C1 ('MetaCons "ObjectDouble" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :+: (C1 ('MetaCons "ObjectStr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :+: C1 ('MetaCons "ObjectBin" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString)))) :+: (C1 ('MetaCons "ObjectArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Object])) :+: (C1 ('MetaCons "ObjectMap" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Object, Object)])) :+: C1 ('MetaCons "ObjectExt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Word8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ByteString))))))

class MessagePack a where Source #

Minimal complete definition

Nothing

Methods

toObject :: Config -> a -> Object Source #

default toObject :: (Generic a, GMessagePack (Rep a)) => Config -> a -> Object Source #

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m a Source #

default fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m, Generic a, GMessagePack (Rep a)) => Config -> Object -> m a Source #

Instances

Instances details
MessagePack Bool Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Double Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Float Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Int Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Int8 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Int16 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Int32 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Int64 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Word Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Word8 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Word16 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Word32 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Word64 Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack () Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack String Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack ByteString Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack ByteString Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Text Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Text Source # 
Instance details

Defined in Data.MessagePack.Types.Class

MessagePack Object Source # 
Instance details

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

Methods

toObject :: Config -> Assoc [(a, b)] -> Object Source #

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (Assoc [(a, b)]) Source #

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

Defined in Data.MessagePack.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (a1, a2) Source #

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

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

Defined in Data.MessagePack.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (a1, a2, a3) Source #

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

Defined in Data.MessagePack.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (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.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (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.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (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.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (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.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (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.Types.Class

Methods

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

fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (a1, a2, a3, a4, a5, a6, a7, a8, a9) Source #

fromObject :: (MonadFail m, MessagePack a) => Object -> m a Source #

Similar to fromObjectWith defaultConfig but returns the result in a MonadFail.

Useful when running in another MonadFail like Maybe.