Questions tagged [dhall]

Dhall is a total programming language tailored for configuration files.

62 questions
1
vote
1 answer

How to represent the following JSON in Dhall?

I am using the following JSON to represent our infrastructure. This is a greatly simplified version. { "us-east-1": { "qa": { "etcd": {} } }, "eu-central-1": { "dev": { "etcd": {} } }, "eu-west-1": { …
Istvan
  • 7,500
  • 9
  • 59
  • 109
1
vote
1 answer

Passing filename to read as a parameter

My configuration reads a certificate from a file. This is a straightforward way: in { devicesCa = "${/path/to/cert/ca.crt as Text}" } I haven't found a way of passing /path/to/cert/ca.crt as a parameter. For instance: let path =…
user11983459
1
vote
1 answer

Escaping string interpolation in Dhall's multi-line strings

For example, how would I escape the interpolation in the following string? let foo = '' docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" docker build -f frontend/Dockerfile-prod \ --build-arg…
sbdchd
  • 580
  • 1
  • 7
  • 18
1
vote
1 answer

dhall-to-yaml: representing unstructured blocks nested within structured yaml

I'm playing around with dhall, trying to represent an existing large yaml file I have instead in dhall. Specifically, I'm trying to build dhall types and helpers for a concourse pipeline definition. Part of the yaml that defines a concourse pipeline…
BooleanCat
  • 21
  • 2
1
vote
1 answer

How to avoid dhall-format convert natural language Text to code point?

I want to write Japanese sentence as Text in dhall file. But the format subcommand convert them to code points. > dhall version 1.18.0 > echo '"Haskellは純粋関数型言語のひとつです"' | dhall…
syocy
  • 111
  • 4
0
votes
1 answer

"unexpected end of input" in `dhall repl`

I can evaluate dhall expressions with dhall --file ..., and I can evaluate 1 + 1 in the repl, but typing a let expression into dhall repl fails with "unexpected end of input." ➜ cat test.dhall let x = 1 let y = 2 in x + y ➜ ~ dhall --file…
Charlie
  • 705
  • 1
  • 5
  • 14
0
votes
1 answer

Reverse a N-N mapping of data in Dhall

Given is a config of apps and containers with an app being able to have multiple containers a container being able to have multiple apps. I want to be able to output them in 2 ways Per app list the containers Per container list the apps The data…
alazeo
  • 65
  • 2
  • 8
0
votes
1 answer

How can I write a ToDhall instance for a ByteString, in Haskell?

So I have a simple data structure that has some ByteStrings. I want to serialize these into Dhall files. However, I apparently can't just automatically derive ToDhall, since there's no instance for ToDhall. How do I write that? data WordBounds =…
Jonathan
  • 10,571
  • 13
  • 67
  • 103
0
votes
1 answer

Dhall - Expression doesn't match annotation, type Text expected

I'm working with Dhall 1.39.0 and getting this error: Error: Expression doesn't match annotation - Text + { … : … } (a record type) [snip] You or the interpreter annotated this expression: [ file contents ] ... with this type or kind: ↳…
Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
0
votes
1 answer

How to type a heterogeneous list in dhall?

I'm using Dhall to generate a Yaml file for github action. In GH Action, you can specify a matrix to generate multiple cases (e.g. combination of Scala version and project name). But you can also specify combination to exclude. For example: runs-on:…
erwan
  • 1,285
  • 5
  • 14
  • 28
0
votes
1 answer

how can i export IntOrString from dhall kubernetes

i want to import : IntOrString from dhall kubernetes, https://github.com/dhall-lang/dhall-kubernetes/blob/master/1.19/types/io.k8s.apimachinery.pkg.util.intstr.IntOrString.dhall; but i don't know how to import it?, i have this code : let kubernetes…
javier_orta
  • 457
  • 4
  • 15
0
votes
1 answer

Defining a list of complex Type in dhall

I have several types defined and two are organized into list (field and option). Functions are defined to help define entries (addfield and addoption). I'm able to define fields and works as expected; however, for options I get an error when the…
dangeroushobo
  • 1,291
  • 2
  • 16
  • 28
0
votes
1 answer

How can I print/encode a value into Dhall?

{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} import Dhall data Example = Example { foo :: Natural, bar :: Vector Double } deriving (Generic, Show) instance Interpret Example main :: IO () main = do putStrLn "Hello,…
Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286
0
votes
1 answer

Dhall Lang Invalid List Type

I am really wanting to use Dhall lang to solve an issue that I have with using the Github Terraform Provider. See: https://github.com/etaty/example-dhall-terraform-github However, I have never used Dhall before and really only have this one use…
0
votes
1 answer

Dhall - map on record field

I have a type let Resource = \(a : Type) -> { name : Text , type : Text , properties : a } and a function foo : InstanceTemplateProperties -> Properties. I need to create a function Resource InstanceTemplateProperties -> Resource…
marcosh
  • 8,780
  • 5
  • 44
  • 74