Questions tagged [dhall]

Dhall is a total programming language tailored for configuration files.

62 questions
2
votes
0 answers

Is there a way to show a Double with no scientific notation in Dhall?

I'm using dhall as a means of defining certain structs which can accept decimals and integers as input. I used the Double type for this as it seemed like a good fit to cover both cases, but I'm running into some issues when rendering them to text…
2
votes
1 answer

How can I access the output of a bazel rule from another rule without using a relative path?

I am attempting to use Bazel to compile a dhall program based on dhall-kubernetes to generate a Kubernetes YAML file. The basic dhall compile without dhall-kubernetes using a simple bazel macro works ok. I have made an example using dhall's…
user2515975
  • 1,052
  • 1
  • 11
  • 18
2
votes
1 answer

Is it possible to get a kubernetes object in json or yaml with all optional fields explicitly set to null?

I'm attempting to migrate a helm/kubernetes codebase to dhall-kubernetes. Dhall is typed, so I need to provide full records with optional fields set to null if there were not set. So I'm looking for something like kubectl get objname id -o yaml, but…
dredozubov
  • 715
  • 1
  • 6
  • 11
2
votes
1 answer

How to merge a dynamically named record with a static one in Dhall?

I'm creating an AWS Step Function definition in Dhall. However, I don't know how to create a common structure they use for Choice states such as the example below: { "Not": { "Variable": "$.type", "StringEquals": "Private" …
JesterXL
  • 308
  • 2
  • 10
2
votes
2 answers

How to validate internal consistency of a config with dhall?

I will start with a motivating example of a config that almost represents an envoy proxy config :) virtual_hosts: - name: webxp-api_http domains: ["*"] routes: - match: { prefix: "/static/v5.0" } route: { cluster: bodhi_static } -…
Adam Saleh
  • 21
  • 1
2
votes
1 answer

What is the dhall idiomatic way to associate different schemas to union values?

I'm trying to represent the pipeline system of the Zuul-CI project using Dhall types: a pipeline can use different connections with different trigger events. I'd like to provide a default pipeline that setups the correct trigger event for each type…
tristanC
  • 35
  • 4
2
votes
1 answer

Dhall Association List

I have a Union type that I wish one field to be an association list. let Blah = < First : { name : Text, params: XXX } | Second : { name : Text } > Here, I wish params to be an association list so when I type check Record values it will pass,…
Alex
  • 8,093
  • 6
  • 49
  • 79
2
votes
1 answer

How to handle enums in dhall?

I need to type and generate a config that contains string enum values. I've managed to define the following lines. In the end I need to convert the union to a string value. let ParameterLocation = < Query : {} | Header : {} …
lorilan
  • 311
  • 1
  • 9
1
vote
1 answer

Dhall: using non-ascii characters as labels in records?

{ "ハルカナホシノセカイへ": "https://www.youtube.com/watch?v=pwl1nISaCNg" } Simply put, is it yet possible to use non-ascii e.g. CJK characters in the labels of Dhall records? Like, to translate the json record above? I tried json-to-dhall which put backticks…
Futarimiti
  • 551
  • 2
  • 18
1
vote
1 answer

dhall-to-yaml: How to consume args value into it

Context: I would like to create the template of service yaml config and pass corresponding parameter or argument to generate different app config file. And the problem I got is how to pass the arg value into the dhall file and how to read the arg…
1
vote
0 answers

Dhall double encodes %2F

I'm using the Gitlab API that needs part of the path URL encoded when fetching files, but for some reason Dhall double-encodes my URL (example uses just google.com to minimize): Welcome to the Dhall v1.41.1 REPL! Type :help for more information. ⊢…
Felix
  • 8,385
  • 10
  • 40
  • 59
1
vote
1 answer

Prelude dhall Error: Connection establishment took too long

Today my dhall project has started crashing on Prelude dependencies, so the main error is: Error: Connection establishment took too long. I use this deps: let List/map = https://prelude.dhall-lang.org/List/map let Map/values =…
javier_orta
  • 457
  • 4
  • 15
1
vote
1 answer

Dhall Repl: strange formatting issues (Powershell on Windows 10 64bit)

When I'm working with dhall repl in Powershell I get a lot of weird output / encoding issues. I'm using the precompiled binaries for windows from https://github.com/dhall-lang/dhall-haskell/releases. An example: Welcome to the Dhall v1.40.1 REPL!…
jules
  • 1,897
  • 2
  • 16
  • 19
1
vote
1 answer

Encoding recursive types to JSON using Dhall

A simplified version of my desired output: { "dynamic-name": { "type": "type", "fields": { "inner-dynamic-name": { "type": "inner-type", "analyzer": "analyzer" } } } } And here's the Dhall code I've…
TheShahin
  • 153
  • 1
  • 12
1
vote
0 answers

How to get more context in extractError?

I have this for decoding well-typed Paths pathDecoder f opts = Decoder { extract = extractPath , expected = expectedPath } where filePathDecoder :: Decoder FilePath filePathDecoder =…