aeson-0.6.2.0: Fast JSON parsing and encoding

Portability | portable
Stability | experimental
Maintainer | Bryan O'Sullivan <bos@serpentine.com>
Safe Haskell | None

Data.Aeson.Encode

Description

Efficiently serialize a JSON value.

Most frequently, you'll probably want to encode straight to UTF-8 (the standard JSON encoding) using `encode`.

You can convert a `Builder` (as returned by `fromValue`) to a string using e.g. `toLazyText`.

Synopsis

- fromValue :: Value -> Builder
- encode :: ToJSON a => a -> ByteString

# Documentation

fromValue :: Value -> Builder

Encode a JSON value to a `Builder`. You can convert this to a string using e.g. `toLazyText`, or encode straight to UTF-8 (the standard JSON encoding) using `encode`.

encode :: ToJSON a => a -> ByteString

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