Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- mpStr :: Text -> Object
- mpInt :: Int -> Object
- mpBool :: Bool -> Object
- mpMap :: [(Text, Object)] -> Object
- mpArray :: [Object] -> Object
- mpBin :: ByteString -> Object
- mpNil :: Object
- mpUnStr :: Object -> Either Text Text
- mpUnInt :: Object -> Either Text Int
- mpUnBool :: Object -> Either Text Bool
- mpUnArray :: Object -> Either Text [Object]
- mpUnMap :: Object -> Either Text [(Object, Object)]
- mpLookup :: Text -> [(Object, Object)] -> Either Text Object
- class MPSerializable a where
- mpSerialize :: a -> Object
- class MPDeserializable a where
- mpDeserialize :: Object -> Either Text a
Convenience functions for construction
mpBin :: ByteString -> Object Source #
Creates a MessagePack binary.
Convenience functions for deconstruction
mpLookup :: Text -> [(Object, Object)] -> Either Text Object Source #
Looks up a key in a deconstructed MessagePack map.
Conversions to and from MessagePack
class MPSerializable a where Source #
mpSerialize :: a -> Object Source #
Converts to a MessagePack representation.
Instances
MPSerializable Display Source # | |
Defined in Lighthouse.Protocol mpSerialize :: Display -> Object Source # | |
MPSerializable ClientMessage Source # | |
Defined in Lighthouse.Protocol mpSerialize :: ClientMessage -> Object Source # | |
MPSerializable Object Source # | |
Defined in Lighthouse.Utils.MessagePack mpSerialize :: Object -> Object Source # |
class MPDeserializable a where Source #
mpDeserialize :: Object -> Either Text a Source #
Converts from a MessagePack representation.
Instances
MPDeserializable InputEvent Source # | |
Defined in Lighthouse.Protocol mpDeserialize :: Object -> Either Text InputEvent Source # | |
MPDeserializable ServerMessage Source # | |
Defined in Lighthouse.Protocol mpDeserialize :: Object -> Either Text ServerMessage Source # | |
MPDeserializable Object Source # | |
Defined in Lighthouse.Utils.MessagePack mpDeserialize :: Object -> Either Text Object Source # | |
MPDeserializable () Source # | |
Defined in Lighthouse.Utils.MessagePack mpDeserialize :: Object -> Either Text () Source # | |
MPDeserializable a => MPDeserializable [a] Source # | |
Defined in Lighthouse.Utils.MessagePack mpDeserialize :: Object -> Either Text [a] Source # |