Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/clovyr/aeson-yaml
Encode any Aeson (JSON) value as YAML (in pure Haskell)
https://github.com/clovyr/aeson-yaml
aeson bsd3 conversion haskell json text web yaml
Last synced: about 8 hours ago
JSON representation
Encode any Aeson (JSON) value as YAML (in pure Haskell)
- Host: GitHub
- URL: https://github.com/clovyr/aeson-yaml
- Owner: clovyr
- License: bsd-3-clause
- Created: 2019-09-30T03:48:05.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-11-05T19:35:14.000Z (about 1 year ago)
- Last Synced: 2024-05-02T01:07:32.792Z (6 months ago)
- Topics: aeson, bsd3, conversion, haskell, json, text, web, yaml
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/aeson-yaml
- Size: 39.1 KB
- Stars: 12
- Watchers: 4
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# aeson-yaml
BSD3-licensed, pure Haskell library to encode any Aeson value as YAML.
## Usage
```haskell
import qualified Data.Aeson.Yaml as Aeson.YamlAeson.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](bin/JsonToYaml.hs) for a simple command-line application
using this library.## Documentation
[Hackage](https://hackage.haskell.org/package/aeson-yaml)
## License
[BSD3](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.