dhall-yaml

Convert between Dhall and YAML

Version on this page:1.2.7
LTS Haskell 21.25:1.2.12@rev:1
Stackage Nightly 2023-06-21:1.2.12@rev:1
Latest on Hackage:1.2.12@rev:3

See all snapshots dhall-yaml appears in

GPL-3.0-only licensed by Gabriel Gonzalez
Maintained by [email protected]
This version can be pinned in stack with:dhall-yaml-1.2.7@sha256:5b01d1b882e01ed5368cfb1bdcebb8bb2b03adbf8fa5370f0bd3c66102a8cd7b,3347

Module documentation for 1.2.7

dhall-yaml

For installation or development instructions, see:

Full documentation here:

Introduction

This dhall-yaml package provides a Dhall to YAML compiler, dhall-to-yaml-ng, and a tool for deriving Dhall from YAML code: yaml-to-dhall.

Note that the dhall-json package also provides a dhall-to-yaml executable. Currently, the behavior of the dhall-to-yaml and dhall-to-yaml-ng executables should not differ much, but eventually the dhall-to-yaml-ng executable should be able to support greater functionality due to using the HsYAML package as an intermediate step in the transformation process.

Tutorials for the analogous JSON tools are available in the dhall-json package:

Example

$ dhall-to-yaml-ng <<< "{ foo = [1, 2, 3], bar = { baz = True } }" > example.yaml
$ cat example.yaml
bar:
  baz: true
foo:
- 1
- 2
- 3
$ yaml-to-dhall '{ foo : List Natural, bar : { baz : Bool } }' < example.yaml
{ bar = { baz = True }, foo = [ 1, 2, 3 ] }

Changes

1.2.7

  • Build against dhall-1.39.0

1.2.6

1.2.5

  • Build against dhall-1.38.0, tasty-1.4, and tasty-silver-3.2

1.2.4

  • Build against dhall-1.37.0

1.2.3

1.2.2

1.2.1

1.2.0

1.1.0

  • BREAKING CHANGE: Add yaml-to-dhall support for inferring the schema
    • You no longer need to provide the command with an explicit schema. The command will infer a reasonably close schema from the provided YAML
    • This is a breaking change because the schema field of the Options type now has type Maybe Text instead of Text
  • Add yaml-to-dhall type subcommand
    • You can use this subcommand to print the inferred schema for a YAML value, so that you can edit the schema and use it for subsequent invocations.
  • Add yaml-to-dhall support for using toMap
    • Now if you specify a Map as the schema, the generated Dhall code will use toMap to improve the appearance

1.0.3

1.0.2

  • Build against dhall-1.30.0

1.0.1

  • Build against dhall-1.29.0

1.0.0

  • Initial release