Portability | portable |
---|---|
Stability | experimental |
Maintainer | Bryan O'Sullivan <bos@serpentine.com> |
JSON handling using Data.Generics
.
This is based on the Text.JSON.Generic
package originally written
by Lennart Augustsson.
Decoding and encoding
decode :: Data a => ByteString -> Maybe aSource
Efficiently deserialize a JSON value from a lazy ByteString
.
If this fails due to incomplete or invalid input, Nothing
is
returned.
This function parses immediately, but defers conversion. See
json
for details.
decode' :: Data a => ByteString -> Maybe aSource
Efficiently deserialize a JSON value from a lazy ByteString
.
If this fails due to incomplete or invalid input, Nothing
is
returned.
This function parses and performs conversion immediately. See
json'
for details.
encode :: Data a => a -> ByteStringSource
Efficiently serialize a JSON value as a lazy ByteString
.