Skip to content

Conversation

rhendric
Copy link
Member

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).

Copy link
Collaborator

@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 good!

@@ -53,6 +53,26 @@ main = do
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should spaces surround the hyphen/dash in existentially — it?

Copy link
Member Author

Choose a reason for hiding this comment

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

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 JordanMartinez changed the base branch from master to updates-for-0.15 April 27, 2022 10:11
@JordanMartinez JordanMartinez merged commit 7fe20f2 into purescript:updates-for-0.15 Apr 27, 2022
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>
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.

4 participants