| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.MessagePack.Types
Synopsis
- newtype Assoc a = Assoc {
- unAssoc :: a
- data Object
- class MessagePack a where
- toObject :: Config -> a -> Object
- fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m a
- data Config
- defaultConfig :: Config
- data DecodeError
- decodeError :: String -> DecodeError
- errorMessages :: DecodeError -> [String]
- fromObject :: (MonadFail m, MessagePack a) => Object -> m a
Documentation
Instances
| Read a => Read (Assoc a) Source # | |
| Show a => Show (Assoc a) Source # | |
| NFData a => NFData (Assoc a) Source # | |
Defined in Data.MessagePack.Types.Assoc | |
| Eq a => Eq (Assoc a) Source # | |
| Ord a => Ord (Assoc a) Source # | |
Defined in Data.MessagePack.Types.Assoc | |
| (MessagePack a, MessagePack b) => MessagePack (Assoc [(a, b)]) Source # | |
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 # | |
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 (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
class MessagePack a where Source #
Minimal complete definition
Nothing
Methods
toObject :: 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
| MessagePack Int16 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Int16 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Int16 Source # | |
| MessagePack Int32 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Int32 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Int32 Source # | |
| MessagePack Int64 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Int64 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Int64 Source # | |
| MessagePack Int8 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Int8 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Int8 Source # | |
| MessagePack Word16 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Word16 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Word16 Source # | |
| MessagePack Word32 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Word32 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Word32 Source # | |
| MessagePack Word64 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Word64 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Word64 Source # | |
| MessagePack Word8 Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Word8 -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Word8 Source # | |
| MessagePack ByteString Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> ByteString -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m ByteString Source # | |
| MessagePack ByteString Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> ByteString -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m ByteString Source # | |
| MessagePack Object Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Object -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Object Source # | |
| MessagePack Text Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Text -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Text Source # | |
| MessagePack Text Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Text -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Text Source # | |
| MessagePack String Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> String -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m String Source # | |
| MessagePack () Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> () -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m () Source # | |
| MessagePack Bool Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Bool -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Bool Source # | |
| MessagePack Double Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Double -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Double Source # | |
| MessagePack Float Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Float -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Float Source # | |
| MessagePack Int Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Int -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Int Source # | |
| MessagePack Word Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Word -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m Word Source # | |
| MessagePack v => MessagePack (IntMap v) Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> IntMap v -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (IntMap v) Source # | |
| (MessagePack a, MessagePack b) => MessagePack (Assoc [(a, b)]) Source # | |
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 a => MessagePack (Vector a) Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Vector a -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (Vector a) Source # | |
| (MessagePack a, Storable a) => MessagePack (Vector a) Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Vector a -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (Vector a) Source # | |
| (MessagePack a, Unbox a) => MessagePack (Vector a) Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Vector a -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (Vector a) Source # | |
| MessagePack a => MessagePack [a] Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> [a] -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m [a] Source # | |
| (MessagePack k, MessagePack v, Ord k) => MessagePack (Map k v) Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> Map k v -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (Map k v) Source # | |
| (MessagePack k, MessagePack v, Hashable k, Eq k) => MessagePack (HashMap k v) Source # | |
Defined in Data.MessagePack.Types.Class Methods toObject :: Config -> HashMap k v -> Object Source # fromObjectWith :: (Applicative m, Monad m, MonadValidate DecodeError m) => Config -> Object -> m (HashMap k v) Source # | |
| (MessagePack a1, MessagePack a2) => MessagePack (a1, a2) Source # | |
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 a1, MessagePack a2, MessagePack a3) => MessagePack (a1, a2, a3) Source # | |
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 # | |
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 # | |
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 # | |
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 # | |
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 # | |
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 # | |
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 # | |
data DecodeError Source #
Instances
| IsString DecodeError Source # | |
Defined in Data.MessagePack.Types.DecodeError Methods fromString :: String -> DecodeError # | |
| Semigroup DecodeError Source # | |
Defined in Data.MessagePack.Types.DecodeError Methods (<>) :: DecodeError -> DecodeError -> DecodeError # sconcat :: NonEmpty DecodeError -> DecodeError # stimes :: Integral b => b -> DecodeError -> DecodeError # | |
| Show DecodeError Source # | |
Defined in Data.MessagePack.Types.DecodeError Methods showsPrec :: Int -> DecodeError -> ShowS # show :: DecodeError -> String # showList :: [DecodeError] -> ShowS # | |
| Eq DecodeError Source # | |
Defined in Data.MessagePack.Types.DecodeError | |
| MonadValidate DecodeError ReadPrec Source # | |
Defined in Data.MessagePack.Types.DecodeError | |
decodeError :: String -> DecodeError Source #
errorMessages :: DecodeError -> [String] Source #
fromObject :: (MonadFail m, MessagePack a) => Object -> m a Source #
Similar to fromObjectWith defaultConfig but returns the result in
a MonadFail.