Skip to content
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

Type error display #52

Merged
merged 3 commits into from
May 6, 2020
Merged

Type error display #52

merged 3 commits into from
May 6, 2020

Conversation

david-christiansen
Copy link
Collaborator

This is the part of #49 that I think is basically non-controversial and involves no major changes to anything. Might as well get it merged once #47 is in.

This does the following, on top of #47:

  1. Unification errors show which sub-terms of the type didn't match, but also the whole type being unified, like GHC's "specifically" clauses
  2. Unification errors contain the zonked type rather than one with gratuitous metas in it
  3. Minor code changes for readability

Type errors are improved by doing the following:

 1. Normalize types in them as far as possible, so it's not just a TyF
 around METAs in the error message

 2. When the unification error occurs in a nested call to unify, call
 that out but also save the original types. Show the inner fail in a
 "Specifically" block as GHC does.
@david-christiansen david-christiansen force-pushed the type-error-display branch 2 times, most recently from 8130c3a to f8fb67b Compare May 6, 2020 02:29
This makes the code easier to understand and improves GHC warnings.
Copy link
Collaborator

@langston-barrett langston-barrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! I wish we had some examples in tests (#42)

@david-christiansen
Copy link
Collaborator Author

Yeah, that'd be nice :)

@david-christiansen david-christiansen merged commit 5a1d403 into master May 6, 2020
@langston-barrett langston-barrett deleted the type-error-display branch May 6, 2020 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants