aeson-yaml: Output any Aeson value as YAML (pure Haskell library)

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

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.


[Skip to ReadMe]

Properties

Versions0.1.0.0, 1.0.0.0, 1.0.1.0, 1.0.2.0
Change logCHANGELOG.md
Dependenciesaeson (>=0.4.0.0 && <1.5), aeson-yaml, base (>=4.5.0.0 && <4.13), bytestring (>=0.10.4.0 && <0.11), text (>=0.1 && <1.3), unordered-containers (>=0.1.0.0 && <0.3), vector (>=0.1 && <0.13) [details]
LicenseBSD-3-Clause
Copyright2019 Clovyr LLC
AuthorPatrick Nielsen
Maintainerpatrick@clovyr.io
CategoryText, Web, JSON, YAML
Home pagehttps://github.com/clovyr/aeson-yaml
Bug trackerhttps://github.com/clovyr/aeson-yaml/issues
Source repositoryhead: git clone https://github.com/clovyr/aeson-yaml
Executablesjson-to-yaml
UploadedMon Sep 30 02:18:58 UTC 2019 by patrick

Modules

[Index]

Flags

NameDescriptionDefaultType
build-binaries

Build the binaries

DisabledManual

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for aeson-yaml-0.1.0.0

[back to package description]

aeson-yaml

BSD3-licensed library to encode any Aeson value as YAML, without a dependency on an external YAML library like yaml (libyaml C FFI) or HsYaml (GPL).

Usage

import qualified Data.Aeson.Yaml as Aeson.Yaml

Aeson.Yaml.encode :: ToJSON a => a -> LazyByteString

-- To encode multiple values, separated by '---' (YAML documents),
-- use `encodeDocuments`.
Aeson.Yaml.encodeDocuments :: ToJSON a => [a] -> LazyByteString

-- To encode values of different types, use `toJSON` from `Data.Aeson`
-- like so:
encodeDocuments [toJSON x, toJSON y, toJSON z]

See bin/JsonToYaml.hs for a simple command-line application using this library.

License

BSD3