Skip to content
Permalink
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
    NaturalFoldZeroA.dhall.
    
    * 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/type-inference.md
    
    Co-Authored-By: Gabriel Gonzalez <Gabriel439@gmail.com>
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
    alternative.
    
    * 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
    cases.
  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.
You can’t perform that action at this time.