aeson-0.8.0.2: Fast JSON parsing and encoding

Copyright(c) 2012 Bryan O'Sullivan (c) 2011 MailRank, Inc.
LicenseApache
MaintainerBryan O'Sullivan <bos@serpentine.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Data.Aeson.Encode

Contents

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 Builders when embedding JSON messages as parts of a protocol.

Synopsis

Documentation

encode :: ToJSON a => a -> ByteString Source

Efficiently serialize a JSON value as a lazy ByteString.

Encoding to Builders

encodeToByteStringBuilder :: Value -> Builder Source

Encode a JSON value to a ByteString Builder. Use this function if you must prepend or append further bytes to the encoded JSON value.

encodeToTextBuilder :: Value -> Builder Source

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

Deprecated

fromValue :: Value -> Builder Source

Deprecated: Use encodeToTextBuilder instead