aeson-0.7.0.6: Fast JSON parsing and encoding

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

Data.Aeson.Encode

Contents

- Encoding to Text Builders
- Deprecated

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 use the conversions to `Builder`s when embedding JSON messages as parts of a protocol.

Synopsis

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

# Documentation

encode :: ToJSON a => a -> ByteString

Encode a JSON `Value` as a UTF-8 encoded `ByteString`.

# Encoding to Text Builders

encodeToTextBuilder :: Value -> Builder

Encode a JSON `Value` to a `Builder`, which can be embedded efficiently in a text-based protocol.

# Deprecated

fromValue :: Value -> Builder

Deprecated: Use `encodeToTextBuilder` instead