Skip to content

Improve apartness checking #4064

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

Merged
merged 3 commits into from
Jun 28, 2021

Conversation

rhendric
Copy link
Member

@rhendric rhendric commented Apr 15, 2021

Instances in an instance chain that don't match the constraint being
searched must be proven apart from the constraint for the search to
continue to the next instance in the chain. This commit tweaks the
apartness checker to fix a variety of incorrect apartness judgments,
and also adds a hint to the NoInstanceFound error message if ambiguous
instances (neither matching nor apart) excluded additional instances in
a chain from consideration.

Description of the change

Fixes #3329, fixes #3531, fixes #3941, fixes #4028.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@rhendric rhendric force-pushed the rhendric/apartness-fixes branch 3 times, most recently from 757a015 to fbea50e Compare April 18, 2021 21:28
@rhendric rhendric force-pushed the rhendric/apartness-fixes branch from 58d11e8 to 1a2f20e Compare May 27, 2021 20:24
@rhendric rhendric marked this pull request as draft May 27, 2021 20:28
@rhendric rhendric force-pushed the rhendric/apartness-fixes branch from 1a2f20e to 76086c4 Compare May 28, 2021 06:15
@rhendric rhendric marked this pull request as ready for review May 28, 2021 06:19
@rhendric rhendric force-pushed the rhendric/apartness-fixes branch from 76086c4 to 8f2019c Compare June 5, 2021 19:12
@rhendric rhendric force-pushed the rhendric/apartness-fixes branch from 8f2019c to c53d24e Compare June 18, 2021 18:30
Instances in an instance chain that don't match the constraint being
searched must be proven apart from the constraint for the search to
continue to the next instance in the chain. This commit tweaks the
apartness checker to fix a variety of incorrect apartness judgments,
and also adds a hint to the NoInstanceFound error message if ambiguous
instances (neither matching nor apart) excluded additional instances in
a chain from consideration.
@rhendric rhendric force-pushed the rhendric/apartness-fixes branch from c53d24e to a5d9a1f Compare June 19, 2021 03:44
Copy link
Contributor

@hdgarrood hdgarrood left a comment

Choose a reason for hiding this comment

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

Looks great! This is going to help a lot with what I think is a relatively common source of confusion.

@rhendric
Copy link
Member Author

Just as a procedural note, I want to land #4118 before this, and then adapt this to use the same error message formatting for unnamed instances.

@hdgarrood
Copy link
Contributor

Sounds good - feel free to go ahead and merge that now if you're ready.

@rhendric rhendric merged commit f195321 into purescript:master Jun 28, 2021
@rhendric rhendric deleted the rhendric/apartness-fixes branch June 28, 2021 21:03
rhendric added a commit that referenced this pull request Jul 2, 2021
rhendric added a commit that referenced this pull request Jul 2, 2021
rhendric added a commit that referenced this pull request Jul 2, 2021
rhendric added a commit to rhendric/purescript that referenced this pull request Jul 3, 2021
rhendric added a commit to rhendric/purescript that referenced this pull request Jul 6, 2021
rhendric added a commit to rhendric/purescript that referenced this pull request Jul 11, 2021
rhendric added a commit to rhendric/purescript that referenced this pull request Jul 11, 2021
@rhendric rhendric mentioned this pull request Jul 12, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants