dhall
A configuration language guaranteed to terminate
| Version on this page: | 1.6.0 |
| LTS Haskell 24.18: | 1.42.3 |
| Stackage Nightly 2025-11-04: | 1.42.3 |
| Latest on Hackage: | 1.42.3 |
dhall-1.6.0@sha256:3ab49113fab3355c7dd50e06d44adf2351d5426bf12fd5c602332bbcd4144f32,4704Module documentation for 1.6.0
Dhall is an explicitly typed configuration language that is not Turing complete. Despite being Turing incomplete, Dhall is a real programming language with a type-checker and evaluator.
Use this library to parse, type-check, evaluate, and pretty-print the Dhall configuration language. This package also includes an executable which type-checks a Dhall file and reduces the file to a fully evaluated normal form.
Read Dhall.Tutorial to learn how to use this library
Changes
1.6.0
- BREAKING CHANGE TO THE API: Drop support for GHC 7.*
- BREAKING CHANGE TO THE API: Add support for customizing Dhall import
- This is a breaking change because this changes the type of
loadWith
- This is a breaking change because this changes the type of
- BREAKING CHANGE TO THE API: Add field to
UnboundVariableerror containing - BUG FIX: Fix parsing single quotes in string literals the name of the unbound variable
- Add
List/concatMapto the Prelude - You can now derive
InjectandInterpretfor types with unlabeled fields - Add new instances for
Interpret:[](,)
- Add new instance for
Inject[],Data.Set.Set,Data.Sequence.Seq(,)Int,Word8,Word16,Word32,Word64
- Add
Eqinstance forSrc
1.5.1
- Increase upper bound on
vectorandoptparse-generic
1.5.0
- BREAKING CHANGE: Add list concatenation operator:
(#)- This is a breaking change because it adds a new constructor to the
Exprtype which breaks exhaustive pattern matches
- This is a breaking change because it adds a new constructor to the
- BREAKING CHANGE: Add
Interpretsupport for lazyText- This is a breaking change because it renames
texttostrictText
- This is a breaking change because it renames
- Add
Interpretinstance for decoding (a limited subset of) Dhall functions - Dhall no longer requires Template Haskell to compile
- This helps with cross-compilation
- Add
rawInpututility for decoding a Haskell value from theExprtype - Add
loadWith/normalizeWithutilities for normalizing/importing modules with a custom context - Export
Typeconstructor
1.4.2
- Fix missing
Preludefiles in package archive uploaded to Hackage
1.4.1
- Fix missing
tests/Tutorial.hsmodule in package archive uploaded to Hackage
1.4.0
- BREAKING CHANGE TO THE LANGUAGE AND API: You can now supply custom headers for
URL imports with the new
usingkeyword- This is a breaking change to the language because this adds a new reserved
usingkeyword - This is a breaking change to the API because this adds a new field to the
URLconstructor to store optional custom headers
- This is a breaking change to the language because this adds a new reserved
- BUG FIX:
:is no longer a disallowed path character- This was breaking URL imports with a port
- BUG FIX: If you import a home-anchored path (i.e.
~/foo) and that imports a relative path (like./bar), then the canonical path of the relative import should be home-anchored (i.e.~/bar). However, there was a bug that made lose the home anchor (i.e../foo/bar), which this release fixes likely fail due to no longer being home-anchored (i.e. `./foob - Add support for string interpolation
mergeno longer requires a type annotation if you are merging at least one alternative- Expanded Prelude
./Prelude/Optional/all./Prelude/Optional/any./Prelude/Optional/filter./Prelude/Optional/length./Prelude/Optional/null./Prelude/Text/concatMap./Prelude/Text/concatMapSep./Prelude/Text/concatSep
- Rearrange detailed error messages to put summary information at the bottom of the message
1.3.0
- BREAKING CHANGE TO THE API: Add support for new primitives, specifically:
(//)- Right-biased and shallow record mergeOptional/build(now a built-in in order to support build/fold fusion)Natural/showInteger/showDouble/showNatural/toInteger- These all add new constructors to the
Exprtype, which would break exhaustive pattern matches
- BREAKING CHANGE TO THE LANGUAGE: Imported paths and URLs no longer support
the characters: “()[]{}<>:”
- This reduces the number of cases where you have to add a space after imports
- Note that this does not exclude the
:in the URL scheme (i.e.http://)
- Increase connection timeout for imports
- Variable names now allow the
-character for all but the first character - You can now escape identifiers with backticks
- This lets you name identifiers so that they don’t conflict with reserved key words
- This is most useful when converting Dhall to other file formats (like JSON) where you might need to emit a field that conflicts with one of Dhall’s reserved keywords
- New
--versionflag for thedhallexecutable
1.2.0
- BREAKING CHANGE: Add support for customizing derived
Interpretinstances- This is a breaking change to the Dhall library API since this changes the
signature of the
Interpretclass by replacing theautomethod with a more generalautoWithmethod. ThisautoWithnow takes anInterpretOptionsargument that lets you customize derived field and constuctor names - In practice user programs that use the common path will be unaffected by this change
- This is not a breaking change to the Dhall language
- This is a breaking change to the Dhall library API since this changes the
signature of the
- BREAKING CHANGE: Type annotations now bind more tightly than lambda
abstraction
-
This is a breaking change to the Dhall language. An expression like this:
λ(x : A) → y : B… used to parenthesized implicitly as:
(λ(x : A) → y) : T… but is now parenthesized implicitly as:
λ(x : A) → (y : T)This is now consistent with Haskell’s precedence and also consistent with the precedence of
ListandOptionaltype annotations -
This change affects programs with an expression like this:
-- Assuming that `y : B` λ(x : A) → y : A → BThe above program would type-check before this change but not type-check after this change. You would you need to fix the above program by either changing the type signature to annotate just the type of
ylike this:λ(x : A) → y : B… or by adding explicit parentheses like this:
(λ(x : A) → y) : A → B -
This is not a breaking change to the Dhall library API
-
- BREAKING CHANGE: Add support for importing a path’s contents as raw
Textby addingas Textafter the import-
This is a breaking change to the Dhall language
-
This is technically a breaking change, but is extremely unlikely to affect you program. This only changes the behavior of old programs that had an expression of the form:
/some/imported/function as Text… where
/some/imported/functionis an imported function being applied to two arguments, the first of which is a bound variable namedasand the second of which is the typeText -
This is not a breaking change to the Dhall library API
-
- BREAKING CHANGE: Add support for importing environment variables using
env:VARsyntax-
This is a breaking change to the Dhall library API since it adds a new
Pathconstructor -
This also technically a breaking change to the Dhall language but extremely unlikely to affect your program. This only changes the behavior of old programs that had an expression of the form:
env:VAR… where
envwas the name of a bound variable and:VARwas a type annotation without spaces around the type annotation operatorAfter this change the program would be interpreted as an import of the contents for the environment variable named
VAR
-
- BREAKING CHANGE: Support importing paths relative to home directory using
~/some/pathsyntax- This is a breaking change to the Dhall library API since it adds a new
field to the
Fileconstructor indicating whether or not the imported path is relative to the home directory - This is not a breaking change to the Dhall language and the new syntax does not override any old syntax
- This is a breaking change to the Dhall library API since it adds a new
field to the
- Permit trailing commas and bars in record/union syntax
- Improve location information for parsing errors
1.1.0
- BREAKING CHANGE: Non-empty lists no longer require a type annotation
- This is a breaking change to the Haskell library, not the Dhall language
- This change does not break existing Dhall programs
- The
Exprtype was modified in a non-backwards-compatible way
- Add new
exprAparser - Add new
InvalidTypeexception ifinputfails on an invalidType - Improve documentation and tutorial
1.0.2
- Add support for Nix-style “double single-quote” multi-line string literals
- Add
isNormalized - Improve documentation and tutorial
- Build against wider range of
http-clientversions
1.0.1
- Initial release
1.0.0
- Accidental premature upload to Hackage. This release was blacklisted