Skip to content
Branch: master
Commits on May 23, 2019
  1. Add test for multiline strings with mixed line endings (#554)

    philandstuff committed May 23, 2019
    * Add test for multiline strings with mixed line endings
    This test case caught a bug in dhall-golang.  It's almost the same as
    multilineBlankLineA.dhall, but the blank line has a CRLF line ending
    instead of a plain LF line ending.  The output CBOR is exactly the same.
    * document line endings in multiline strings
  2. More fixes to unit tests (#553)

    philandstuff committed May 23, 2019
    * require `Natural/fold 1` to call its function
    I implemented `Natural/fold` enough to pass NaturalFoldZeroA.dhall and
    was surprised to see NaturalFoldOneA.dhall also passed.  This changes
    NaturalFoldOneA.dhall so that it won't pass if `Natural/fold` is
    implemented as
        Natural/fold _ _ _ x = x
    which was my minimal implementation intended to pass
    * remove duplicate tests
    these tests duplicate tests in the /unit/ directory.
    * note that `Text/show` skips interpolated text
    It wasn't particularly explict that `Text/show` only operates on text
    literals containing no interpolations.  This makes it clearer.
    Also, add an explicit test for this case.
    * tests for List/{head,last}: test longer lists
    If we only test singleton lists, we don't test that we're actually
    fetching the correct element.
    * fix typo in test
Commits on May 14, 2019
  1. Prelude/JSON/Nesting: use empty union alternatives (#541)

    philandstuff committed May 14, 2019
    Now that empty union alternatives are a language feature, we should use
    them in Prelude too.
  2. fix union constructor type inference judgments (#538)

    philandstuff and Gabriel439 committed May 14, 2019
    * fix union constructor type inference judgments
    The union constructor type inference judgments didn't infer types for
    expressions of the form
        let MaybeNat = < Just Natural | Nothing > in MaybeNat.Nothing
    because they required the union type to already be in normal form.  This
    fixes that.
    It also removes a somewhat-duplicate judgment for union constructors,
    which would be able to type check `u.x` provided that a) `x` selected a
    union alternative with a type (not an empty alternative), and b) `u` was
    a union type with a minimum of two alternatives.  Once we fix the main
    judgments, this extra judgment is entirely redundant.
    * Update standard/
    Co-Authored-By: Gabriel Gonzalez <>
Commits on May 12, 2019
  1. Improve use of unions in tests (#540)

    philandstuff committed May 12, 2019
    * delete alternativesAreTypesA.dhall
    this is a byte-for-byte duplicate of unionOfTypesA.dhall in the
    same directory
    * Stop using empty records as union alternatives
    Now that we have empty union alternatives, we don't need to use empty
    records as singleton union alternative types in our tests.  Our tests
    are also example code, and we should aim to keep them idiomatic as the
    language evolves.
    * add missing merge test case
    We didn't have a unit test for type inference on merging an empty
    * tests: don't use union literals unless necessary
    Union literals are deprecated in favour of union constructors.
    Therefore, tests should prefer union constructors over union literals
    except in cases where union literals cannot be avoided.  This is mainly
    in cases where union literals themselves are being tested.
    I also changed some filenames to make clear when union literals are
    under test.
  2. tests: don't use old optional syntax unless necessary (#539)

    philandstuff committed May 12, 2019
    The old optional syntax (which looks like a funny annotated list) is
    deprecated in favour of `Some` and `None`.
    Therefore, tests should prefer `Some` and `None` over old optional
    literals except in cases where they cannot be avoided.  This is mainly
    in cases where old optional literals themselves are being tested.
Commits on May 9, 2019
  1. Simplify all eligible text literals (#529)

    philandstuff committed May 9, 2019
    Fixes #528.
    The previous semantics would not normalize a text literal such as
    "${""}${x}" to x, because it didn't match the "Simplify a `Text`
    literal" rule.  This also affected expressions like "" ++ x.
    This is my first time trying to edit the semantics, please give (gentle)
    feedback :)
  2. add missing base cases for union type type inference (#530)

    philandstuff committed May 9, 2019
    The only way for a union type to have type `Kind` was using the rule:
         Γ ⊢ T :⇥ Kind   Γ ⊢ < ts… > :⇥ Kind
         ───────────────────────────────────  ; x ∉ < ts… >
         Γ ⊢ < x : T | ts… > : Kind
    but this requires, as input, a union type of type `Kind`.  With no base
    case to start the process, there was no way to construct a union type of
    type `Kind`.  The same was true for union types of type `Sort`.
    Also, make it clear that it's not a type error for a union alternative
    to be a `Kind` (and so for the union type itself to have type `Sort`).
  3. Tidy up prelude (#531)

    philandstuff committed May 9, 2019
    * run `dhall format` over Prelude
    the `let` expressions indented in the old way was a little annoying
    * remove usage of `constructors` from example code
    Some of the example code in Prelude used the now-removed `constructors`
    keyword.  This removes it and runs the example through `dhall format`.
Commits on May 7, 2019
  1. add unit test for type inference of empty alternative (#532)

    philandstuff committed May 7, 2019
    This case was missing from the type inference unit tests.
Commits on May 1, 2019
  1. split import tests up into unit tests (#517)

    philandstuff committed May 1, 2019
    This splits up the various import tests, so that each feature can be
    tested separately as it is implemented.  It also adds one or two new
  2. update test README to match directory name (#516)

    philandstuff committed May 1, 2019
    The directory was renamed in 7ea70fb
  3. Explain the encoding labelling scheme (#503)

    philandstuff committed May 1, 2019
    * Explain the encoding labelling scheme
    Also, use "label" instead of "tag", because the word "tag" has another
    meaning in CBOR.
    Fixes #371.
    Also, fix an input/output typo.
    * remove outdated use of "untagged"
    “untagged" in this context meant a Dhall expression without a version number. That is a legacy from back when the binary encoding added a version number to the encoded expression and should be removed.
Commits on Apr 30, 2019
  1. add missing commas (#513)

    philandstuff committed Apr 30, 2019
Commits on Apr 28, 2019
  1. tests: Don't escape strings in CBOR encoding (#504)

    philandstuff committed Apr 28, 2019
    Fixes #502.
    This fixes environmentVariablesB.dhallb to not escape the special
    characters in the CBOR-encoded string.  The ABNF says that these escape
    sequences should be parsed as special characters, and says to
    encode as CBOR strings, which don't need any special escaping.
    Also, I took the liberty of specifying that *.dhallb files should be
    diffed as CBOR files.  If you install cbor-diag, and add a block to your
    git config like this:
        [diff "cbor"]
            textconv = cbor2diag.rb
            binary = true
    then `git diff` will show changes to your *.dhallb files by first
    decoding to CBOR diagnostic notation.
Commits on Apr 13, 2019
  1. fix minor typo (#477)

    philandstuff committed Apr 13, 2019
    all the other builtins are in alphabetical order. Also, the comments
    were mismatched.
Commits on Apr 8, 2019
  1. Remove duplicate test (#460)

    philandstuff committed Apr 8, 2019
    this is a duplicate of RecordSelectionNormalizeArguments.  Maybe a
    single test with a more revealing name could be used instead?
    I understand why these two tests exist, but I think there's something
    not quite right about having two distinct tests be functionally
    identical like this.
Commits on Apr 7, 2019
  1. improve documentation of tests/parser/failure/boundBuiltins.dhall (#459)

    philandstuff committed Apr 7, 2019
    My implementation was failing this test, but the comments above the
    `label` rule weren't helpful.  In #442, the restriction migrated to
    the `nonreserved-label` rule, but this comment wasn't updated.
Commits on Feb 16, 2019
  1. restore doubleB.json (#372)

    philandstuff committed Feb 16, 2019
    Seems this was mistakenly truncated.  This just reverts the change to
    the old content.
Commits on Feb 9, 2019
  1. Fix types in parser tests (#366)

    philandstuff authored and Gabriel439 committed Feb 9, 2019
    The parser tests had a number of cases where they had Natural and
    Integer syntax swapped round.  This presumably dates from before #138
    switched the grammar of Integer and Natural.
    Note that this difference doesn't actually matter for these parsing
    tests, because an expression like `+1 : Natural` still parses correctly,
    it just fails to typecheck.  But I found it confusing to have the syntax
    so consistently backwards in the tests, so I thought it was worth
Commits on Dec 15, 2018
  1. Fix link to (#321)

    philandstuff authored and Gabriel439 committed Dec 15, 2018
You can’t perform that action at this time.