Data.Aeson.Generic

aeson-0.9.0.1: Fast JSON parsing and encoding

Copyright | (c) 2011, 2012, 2013 Bryan O'Sullivan (c) 2011 MailRank, Inc. (c) 2008, 2009 Lennart Augustsson
License | BSD3
Maintainer | Bryan O'Sullivan <bos@serpentine.com>
Stability | DEPRECATED
Portability | portable
Safe Haskell | None
Language | Haskell98

Data.Aeson.Generic

Contents

- Decoding and encoding
- Lower-level conversion functions

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

- decode :: Data a => ByteString -> Maybe a
- decode' :: Data a => ByteString -> Maybe a
- encode :: Data a => a -> ByteString
- fromJSON :: Data a => Value -> Result a
- toJSON :: Data a => a -> Value

# Decoding and encoding

decode :: Data a => ByteString -> Maybe a

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 a

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 -> ByteString

Efficiently serialize a JSON value as a lazy `ByteString`.

# Lower-level conversion functions

fromJSON :: Data a => Value -> Result a

toJSON :: Data a => a -> Value