Safe Haskell | None |
---|---|
Language | Haskell2010 |
Encoding and decoding of ByteString
and serialisable values
as base16 encoded JSON strings
Synopsis
- encodeByteString :: ByteString -> Text
- decodeByteString :: Value -> Parser ByteString
- encodeSerialise :: Serialise a => a -> Text
- decodeSerialise :: Serialise a => Value -> Parser a
- tryDecode :: Text -> Either String ByteString
- newtype JSONViaSerialise a = JSONViaSerialise a
Documentation
encodeByteString :: ByteString -> Text Source #
decodeByteString :: Value -> Parser ByteString Source #
encodeSerialise :: Serialise a => a -> Text Source #
decodeSerialise :: Serialise a => Value -> Parser a Source #
newtype JSONViaSerialise a Source #
Newtype for deriving ToJSON
and FromJSON
for types that have a Serialise
instance by just encoding the serialized bytes as a JSON string.
Instances
Serialise a => FromJSON (JSONViaSerialise a) Source # | |
Defined in Data.Aeson.Extras parseJSON :: Value -> Parser (JSONViaSerialise a) parseJSONList :: Value -> Parser [JSONViaSerialise a] | |
Serialise a => ToJSON (JSONViaSerialise a) Source # | |
Defined in Data.Aeson.Extras toJSON :: JSONViaSerialise a -> Value toEncoding :: JSONViaSerialise a -> Encoding toJSONList :: [JSONViaSerialise a] -> Value toEncodingList :: [JSONViaSerialise a] -> Encoding |