Skip to content

v8.0.0

Compare
Choose a tag to compare
@Gabriella439 Gabriella439 released this 03 Jun 15:01
· 471 commits to master since this release
136a349

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.

  • Simplify bare interpolations

    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.

  • Allow Sort as type annotation

    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 fetch foo.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: