Safe Haskell | None |
---|
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 b) => StateT (Producer ByteString m r) m (Either DecodingError (Int, b))
- decodeMany :: (Monad m, FromJSON b) => Producer ByteString m r -> Producer (Int, b) m (Either (DecodingError, Producer ByteString m r) r)
Encoding
Decoding
decode :: (Monad m, FromJSON b) => StateT (Producer ByteString m r) m (Either DecodingError (Int, b))Source
:: (Monad m, FromJSON b) | |
=> Producer ByteString m r | Producer from which to draw JSON. |
-> Producer (Int, b) m (Either (DecodingError, Producer ByteString m r) r) |
Like decodeMany
, except it will decode any ToJSON
instance, not just Array
or Object
.