Safe Haskell | None |
---|---|
Language | Haskell98 |
This module exports facilities similar to those exported by the
Pipes.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 :: (Monad m, ToJSON a) => a -> Producer' ByteString m ()
- decode :: (Monad m, FromJSON a) => Parser ByteString m (Maybe (Either DecodingError a))
- decoded :: (Monad m, FromJSON a, ToJSON a) => Lens' (Producer ByteString m r) (Producer a m (Either (DecodingError, Producer ByteString m r) r))
- decodeL :: (Monad m, FromJSON a) => Parser ByteString m (Maybe (Either DecodingError (Int, a)))
- decodedL :: (Monad m, FromJSON a, ToJSON a) => Lens' (Producer ByteString m r) (Producer (Int, a) m (Either (DecodingError, Producer ByteString m r) r))
Encoding
Decoding
:: (Monad m, FromJSON a) | |
=> Parser ByteString m (Maybe (Either DecodingError a)) |
:: (Monad m, FromJSON a, ToJSON a) | |
=> Lens' (Producer ByteString m r) (Producer a m (Either (DecodingError, Producer ByteString m r) r)) |
Including lenghts
:: (Monad m, FromJSON a) | |
=> Parser ByteString m (Maybe (Either DecodingError (Int, a))) |
Like decode
, except it also returns the length of JSON input that was
consumed in order to obtain the value, not including the length of whitespace
between each parsed JSON input.
:: (Monad m, FromJSON a, ToJSON a) | |
=> Lens' (Producer ByteString m r) (Producer (Int, a) m (Either (DecodingError, Producer ByteString m r) r)) |
Like decoded
, except it also tags each decoded entity with the length of
JSON input that was consumed in order to obtain the value, not including the
length of whitespace between each parsed JSON input.