aeson-0.6.2.1: Fast JSON parsing and encoding

Portabilityportable
StabilityDEPRECATED
MaintainerBryan O'Sullivan <bos@serpentine.com>
Safe HaskellNone

Data.Aeson.Generic

Contents

Description

Deprecated: This module will be REMOVED in version 0.7.0.0. Please switch to GHC generics or Data.Aeson.TH instead. These alternatives are less buggy, faster, and more configurable.

JSON handling using Generics.

This is based on the Generic package originally written by Lennart Augustsson.

Synopsis

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.

Lower-level conversion functions

toJSON :: Data a => a -> ValueSource