Describe ambiguous matches in instance chains#392
Merged
Conversation
milesfrain
reviewed
Jun 30, 2021
| log $ myShow MysteryItem -- Invalid | ||
| ``` | ||
|
|
||
| When type variables are present in the constraint being solved, the question of whether an instance in a chain matches is a little subtle. A type variable in the constraint is treated existentially—it represents some concrete type, but the constraint solver isn't allowed to assume that it is any particular type. This means that, when evaluating an instance as a solution for a particular constraint, there are three possible outcomes for the instance: it can match, it can fail to match, or it can be ambiguous. An ambiguous instance is one that could match the constraint only if one or more of the variables in the constraint happened to represent a particular type. |
Contributor
There was a problem hiding this comment.
Should spaces surround the hyphen/dash in existentially — it?
Member
Author
There was a problem hiding this comment.
The fixed-width font obscures it, but that's an em dash—like this. I see em dashes set off with spaces in newspapers, but for other writing I don't think spaces are typical.
Is a spaced hyphen generally used in place of an em dash in these docs? I can change it if so; the dash was just a reflexive choice.
JordanMartinez
approved these changes
Jul 2, 2021
4 tasks
JordanMartinez
added a commit
that referenced
this pull request
Apr 29, 2022
* First draft of documentation update for v0.15 (#421) * First draft of documentation update for v0.15 * Describe ambiguous matches in instance chains (#392) * Update tool versions * Update parsing library changelog * Update 0.15 guides to account for `Stream.write` breaking change Co-authored-by: sigma-andex <77549848+sigma-andex@users.noreply.github.com> Co-authored-by: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
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.
This documents the new-ish behavior in purescript/purescript#4064; it should be merged only once a release is made which includes that PR (it's about to be reverted at the moment because it's a breaking change).