Allow all annotations to take full expressions#1230
Merged
Gabriella439 merged 2 commits intodhall-lang:masterfrom Oct 21, 2021
Merged
Allow all annotations to take full expressions#1230Gabriella439 merged 2 commits intodhall-lang:masterfrom
Gabriella439 merged 2 commits intodhall-lang:masterfrom
Conversation
(Sorry)
Instead of just application expressions, since some annotations
were allowed to take full expressions, it makes sense to allow
them all to do so.
Otherwise there are weird corner cases like
merge { x = λ(y : Bool) → y } < x >.x : (∀(y : Bool) → Bool)
parses as a merge-with-annotation while
merge { x = λ(y : Bool) → y } < x >.x : ∀(y : Bool) → Bool
parses as a merge-without-annotation plus annotation, just like
(merge { x = λ(y : Bool) → y } < x >.x) : ∀(y : Bool) → Bool
Now the first two will parse the same.
Gabriella439
approved these changes
Oct 1, 2021
Contributor
Gabriella439
left a comment
There was a problem hiding this comment.
I think it's a totally fine breaking change that's unlikely to affect many people in practice
Contributor
|
Sorry, I totally forgot to merge this! 😅 Thank you for doing this |
Gabriella439
added a commit
to dhall-lang/dhall-haskell
that referenced
this pull request
Oct 21, 2021
… as standardized in dhall-lang/dhall-lang#1230
Gabriella439
added a commit
to dhall-lang/dhall-haskell
that referenced
this pull request
Oct 23, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of just application expressions, since some annotations were allowed to take full expressions, it makes sense to allow them all to do so.
Otherwise there are weird corner cases like
merge { x = λ(y : Bool) → y } < x >.x : (∀(y : Bool) → Bool)parses as a merge-with-annotation while
merge { x = λ(y : Bool) → y } < x >.x : ∀(y : Bool) → Boolparses as a merge-without-annotation plus annotation, just like
(merge { x = λ(y : Bool) → y } < x >.x) : ∀(y : Bool) → Bool(from https://github.com/dhall-lang/dhall-lang/blob/1907a1d1a6dff9ff8638547f7bc49d6b5135bcdf/tests/type-inference/success/unit/MergeOneWithAnnotation1A.dhall)
Now the second will parse like the first, instead of like the last.
Of course we should discuss whether this is a breaking change, but I think the actual user-facing effects will be minimal, since the difference in annotations are normalized away.
This came up in fixing my pretty printer – I don't think there's a good way for me to disambiguate the old way correctly within my current system of precedence.
I also removed trailing spaces in a separate commit and noticed that the file uses CRLF line endings which is very weird. Happy to revert that commit if you want …