dhall-haskell/dhall-bash
Gabriel Gonzalez 5c690f9ca1
Add enum support to dhall-bash (#873)
... as mentioned here: https://github.com/dhall-lang/dhall-haskell/issues/97#issuecomment-477699974

Similar to `dhall-json`, this translates empty alternatives to
strings of the same name
2019-03-30 10:14:33 -07:00
..
exec Migrate dhall-{bash,json,text} into this repository (#661) 2018-10-28 17:32:51 -07:00
src/Dhall Add enum support to dhall-bash (#873) 2019-03-30 10:14:33 -07:00
default.nix Install mostly static executables on OS X when using Nix (#830) 2019-03-04 19:43:31 -08:00
dhall-bash.cabal Fix versions of dhall-bash/dhall-text (#845) 2019-03-07 21:12:03 -08:00
LICENSE Migrate dhall-{bash,json,text} into this repository (#661) 2018-10-28 17:32:51 -07:00
README.md Version 1.19.1 → 1.20.0 (#767) 2018-12-29 11:48:21 -06:00
Setup.hs Migrate dhall-{bash,json,text} into this repository (#661) 2018-10-28 17:32:51 -07:00
shell.nix Migrate dhall-{bash,json,text} into this repository (#661) 2018-10-28 17:32:51 -07:00

dhall-bash

For installation or development instructions, see:

Full documentation here:

Introduction

This dhall-bash package provides a Dhall to Bash compiler so that you can easily marshall Dhall values into your Bash scripts

This does not compile all available Dhall language constructs into Bash and only supports extracting primitive values, lists, optional values and records from normalized expressions.

Example

$ dhall-to-bash <<< '1'
1
$ dhall-to-bash <<< '"ABC" ++ "DEF"'
ABCDEF
$ dhall-to-bash --declare FOO <<< '"ABC" ++ "DEF"'
declare -r FOO=ABCDEF
$ eval $(dhall-to-bash --declare FOO <<< '"ABC" ++ "DEF"')
$ echo "${FOO}"
ABCDEF
$ dhall-to-bash --declare BAR
let replicate = https://prelude.dhall-lang.org/List/replicate
in  replicate 10 Natural 1
<Ctrl-D>
declare -r -a BAR=(1 1 1 1 1 1 1 1 1 1)
$ dhall-to-bash --declare BAZ <<< '{ qux = 1, xyzzy = True }'
declare -r -A BAZ=([qux]=1 [xyzzy]=true)