Safe Haskell | None |
---|---|
Language | Haskell2010 |
This library exposes functions for encoding any Aeson value as YAML. There is also support for encoding multiple values into YAML "documents".
This library is pure Haskell, and does not depend on C FFI with libyaml. It is also licensed under the BSD3 license.
This module is meant to be imported qualified.
Synopsis
- encode :: ToJSON a => a -> ByteString
- encodeDocuments :: ToJSON a => [a] -> ByteString
- encodeQuoted :: ToJSON a => a -> ByteString
- encodeQuotedDocuments :: ToJSON a => [a] -> ByteString
Documentation
encode :: ToJSON a => a -> ByteString Source #
Encode a value as YAML (lazy bytestring).
encodeDocuments :: ToJSON a => [a] -> ByteString Source #
Encode multiple values separated by '\n---\n'. To encode values of different
types, import Data.Aeson(ToJSON(toJSON))
and do
encodeDocuments [toJSON x, toJSON y, toJSON z]
.
encodeQuoted :: ToJSON a => a -> ByteString Source #
Encode a value as YAML (lazy bytestring). Keys and strings are always quoted.
encodeQuotedDocuments :: ToJSON a => [a] -> ByteString Source #
Encode multiple values separated by '\n---\n'. Keys and strings are always quoted.