-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add textual information for Record and Union diff #1851
Conversation
This change improves error messages when argument types are wrong. Fixes dhall-lang#1846
Example:
|
New examples:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all you need to do to fix the build failure is to update the doctest in src/Dhall/Deriving.hs
to reflect the new error message
@@ -576,6 +578,7 @@ skeleton (Union {}) = | |||
<> ignore | |||
<> " " | |||
<> rangle | |||
<> " (a union type)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "a union"? It's talking about an instance of a union type, I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@timbertson: No, this is a union type. A union value is of the form UnionType.Alternative x
Thanks! Don't suppose you could add "(a function)" to the |
9c66c23
to
1bc2a77
Compare
@timbertson last commit adds "(a function)" message to
And that wouldn't work for return type:
I guess "(a function)" needs to be added to |
Thanks BTW – I think this will make some errors much easier to understand! :) |
BTW, Hydra OOM'd again (error 137), with GHC 8.4.3. This has been happening repeatedly in the last few days, possibly due to more contributions during ZuriHac. I'm wondering though whether it might be time to upgrade to a machine with more RAM. If costs are an issue, maybe it could be financed from the donations? |
@sjakobi: Cost would be an issue 🙂. I currently pay $40 / month for a Linode with 8 GB of RAM. The next tier with 16 GB would be $80 / month, which would consume a significant fraction of our donation budget. I would personally wait to see if it's still a problem now that Zurihac's over |
Sure. Of course we could also look at cheaper providers, as for example |
@Gabriel439 I believe the OOM'ing Hydra job needs to be restarted: https://hydra.dhall-lang.org/build/61554/nixlog/2 |
This change improves error messages when argument types are wrong.
Fixes #1846