v8.0.0
Breaking changes:
-
Allow tabs and blank lines in multiline strings
This changes two things about how multiline strings handle whitespace:
-
Blank lines are now ignored for the purpose of dedenting multiline strings
Previously empty lines would still require the same number of leading spaces
as other lines in order for multiline string literals to be properly
dedented.For example, the following multi-line string is now dedented:
let example = ␠␠␠␠␠␠'' ␠␠␠␠␠␠foo ␠␠␠␠␠␠bar ␠␠␠␠␠␠'' in …
... to this equivalent double-quoted string literal:
"foo\n\nbar\n"
-
Multiline literals with leading tabs will now also be dedented
To be precise, multiline literals will now dedent any shared prefix
consisting of tabs and spaces so long as each (non-blank) line begins with
the same prefix, such as this code:let example = ␉␠'' ␉␠foo ␉␠bar ␉␠'' in …
... which also desugars to the same double-quoted string literal:
"foo\n\nbar\n"
This is a breaking change because multi-line string literals with blank lines
or leading tabs are now interpreted differently. However, expressions that
padded blank lines with leading whitespace are unaffected by this change. -
-
String literals that do nothing but interpolate a single expression are now
simplified to that expression.For example, this code:
λ(x : Text) → "${x}"
... now normalizes to this code:
λ(x : Text) → x
This is technically a breaking change because semantic integrity checks will
change for any expressions that can be simplified in this way. However,
functionally this has no change on the code's behavior as the simplified code
is extensionally equal to the original code.There is also another related change within this same release:
-
Encode integrity check as multihash
This changes how imports with semantic integrity checks are serialized by
updating them to follow the multihash
standard.This is a technically breaking change if you serialize uninterpreted
expressions that contain imports, but this has no effect on semantic integrity
checks, which are computed from fully-resolved expressions.
New features:
-
Record projection by expression
You can now project out a subset of record fields by specifying the expected
type. For example, this expression:let e = { a = 10, b = "Text" } let s = { a : Natural } in e.(s)
... normalizes to:
{ a = 10 }
In other words, the type can be used as a record selector if surrounded with
parentheses. -
Before this change
Sort
was not permitted anywhere within an expression and
could only appear as the inferred type of an expression.Now
Sort
can be used as a type annotation, such as:Kind : Sort
... but is still forbidden elsewhere within expressions.
This is not a breaking change: this only permits more expressions to
type-check than before. -
Standardize support for header forwarding and inline headers
This makes two changes to the language:
-
You can now specify custom headers inline, like this:
https://httpbin.org/user-agent using [ { header = "User-Agent", value = "Dhall" } ] as Text
... instead of having to specify them in a separate import
-
Headers are now automatically forwarded to relative imports
In other words, if you import
https://example.com/foo.dhall using someHeaders
and that in turn imports./bar.dhall
then that will resolve to
https://example.com/bar.dhall using someHeaders
. In other words, the
same headers used to fetchfoo.dhall
will also be used to fetch
bar.dhall
.This is most commonly used resolve transitive imports for expressions hosted
within a private repository that requires authenticated headers.
-
-
Allow self-describe-cbor when decoding
This extends the binary decoding logic to permit (and ignore) CBOR tag 55799,
as required by the CBOR RFC.This is not a breaking change: this only permits more CBOR expressions to be
decoded than before.
Other changes:
-
Fixes and improvements to the standard
- Clarify which judgement is introduced by each section of the semantics
- Use ASCII names for standard files
- Add missing commas
- Explain the encoding labelling scheme
- Clarify release process
- Update test
README
to match directory name - Fix typo: β-normalization → α-normalization
- Fix IP parsing
- Add missing base cases for union type type inference
- Fix union constructor type inference judgments
-
Fixes and improvements to the standard test suite
- Don't escape strings in CBOR encoding
- Split import tests up into unit tests
- A simple test case that found a bug in
dhall-ruby
- Add regression test for alpha normalization
- Add some tests
- Fix multiline test
- Add unit test for type inference of empty alternative
- Isolate
FunctionNestedBindingXXFree
- Fix self describe CBOR tests
- Don't use old optional syntax unless necessary
- Improve use of unions in tests
- More fixes to unit tests
- Add test for multiline strings with mixed line endings
- Upstream regression test
- Add test for hash mismatch
-
Fixes and improvements to the Prelude