Safe Haskell | None |
---|
This module exports facilities similar to those exported by the
Control.Proxy.Aeson module, except they do not restrict the Value
s
that might be encoded or decoded to be just valid top-level values. That is,
not only Object
s or Array
s, according to to the RFC-4627 JSON
standard.
- encode :: (Proxy p, Monad m, ToJSON a) => a -> p x' x () ByteString m ()
- encodeD :: (Proxy p, Monad m, ToJSON a) => () -> Pipe p a ByteString m r
- decode :: (Monad m, Proxy p, FromJSON r) => EitherP DecodingError (StateP [ByteString] p) () (Maybe ByteString) y' y m r
- decodeD :: (Monad m, Proxy p, FromJSON b) => () -> Pipe (EitherP DecodingError (StateP [ByteString] p)) (Maybe ByteString) b m ()
- parseValue :: (Monad m, Proxy p) => EitherP ParsingError (StateP [ByteString] p) () (Maybe ByteString) y' y m Value
- parseValueD :: (Monad m, Proxy p) => () -> Pipe (EitherP ParsingError (StateP [ByteString] p)) (Maybe ByteString) Value m ()
- data DecodingError
Encoding
Decoding
decode :: (Monad m, Proxy p, FromJSON r) => EitherP DecodingError (StateP [ByteString] p) () (Maybe ByteString) y' y m rSource
decodeD :: (Monad m, Proxy p, FromJSON b) => () -> Pipe (EitherP DecodingError (StateP [ByteString] p)) (Maybe ByteString) b m ()Source
Lower level parsing
parseValue :: (Monad m, Proxy p) => EitherP ParsingError (StateP [ByteString] p) () (Maybe ByteString) y' y m ValueSource
Like parseValue
, except it will parse into any
Value
.
parseValueD :: (Monad m, Proxy p) => () -> Pipe (EitherP ParsingError (StateP [ByteString] p)) (Maybe ByteString) Value m ()Source
Like parseValueD
, except it will parse into any
Value
.
Types
data DecodingError Source
An error while decoding a JSON value.
ParserError ParsingError | An Attoparsec error that happened while parsing the raw JSON string. |
ValueError String | An Aeson error that happened while trying to convert a
|