| CARVIEW |
aeson-yaml: Output any Aeson value as YAML (pure Haskell library)
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]
Flags
Manual Flags
| Name | Description | Default |
|---|---|---|
| build-binaries | Build the binaries | Disabled |
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
Downloads
- aeson-yaml-1.1.0.1.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 1.0.0.0, 1.0.1.0, 1.0.2.0, 1.0.3.0, 1.0.4.0, 1.0.5.0, 1.0.6.0, 1.1.0.0, 1.1.0.1 |
|---|---|
| Change log | CHANGELOG.md |
| Dependencies | aeson (>=0.4.0.0 && <2.3), aeson-yaml, base (>=4.8.2.0 && <5), bytestring (>=0.10.4.0 && <0.13), text (>=0.1 && <2.2), unordered-containers (>=0.1.0.0 && <0.3), vector (>=0.1 && <0.14) [details] |
| License | BSD-3-Clause |
| Copyright | 2019 Clovyr LLC |
| Author | Patrick Nielsen |
| Maintainer | patrick@clovyr.io |
| Uploaded | by patrick at 2021-11-13T19:12:22Z |
| Revised | Revision 4 made by patrick at 2023-11-05T19:34:41Z |
| Category | Text, Web, JSON, YAML |
| Home page | https://github.com/clovyr/aeson-yaml |
| Bug tracker | https://github.com/clovyr/aeson-yaml/issues |
| Source repo | head: git clone https://github.com/clovyr/aeson-yaml |
| Distributions | Arch:1.1.0.1, Fedora:1.1.0.1, LTSHaskell:1.1.0.1, NixOS:1.1.0.1, Stackage:1.1.0.1 |
| Reverse Dependencies | 1 direct, 7 indirect [details] |
| Executables | json-to-yaml |
| Downloads | 7287 total (36 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user Build status unknown [no reports yet] |
Readme for aeson-yaml-1.1.0.1
[back to package description]aeson-yaml
BSD3-licensed, pure Haskell library to encode any Aeson value as YAML.
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.
Documentation
License
Motivation
This library does not depend on any external YAML library with C bindings,
like yaml, or a restrictive license, like HsYaml (GPLv3). Note, though,
that this library can only be used for encoding, not decoding.
This library also works with GHCJS and Eta.