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

Document 87429 #156

Merged
merged 3 commits into from
Jun 14, 2022
Merged

Document 87429 #156

merged 3 commits into from
Jun 14, 2022

Conversation

PPKFS
Copy link
Contributor

@PPKFS PPKFS commented Jun 13, 2022

No description provided.

title: Illegal datatype context
summary: Constraints present in datatype declaration without DatatypeContexts.
severity: error
introduced: 9.6.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add extensions that have to accompany this error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So by default, no extensions are needed to get the error. There is a possible extension to fix the error, but because it's deprecated I have not been using said error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the unnecessary NoDatatypeContexts pragma.


Without the language extension `DatatypeContexts` enabled, it is illegal to add constraints to the context of a datatype definition. Whilst this can be solved with enabling `DatatypeContexts`, *however* this extension is deprecated and is considered a misfeature. Other solutions to fix this can include:

- Placing constraints on the *use-site* of a datatype, or
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add example of such "after" fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a second example.

@PPKFS PPKFS requested a review from mknorps June 13, 2022 11:20
@david-christiansen
Copy link
Collaborator

@mknorps are you satisfied with the updates?

@mknorps mknorps merged commit effd5b8 into haskell:main Jun 14, 2022
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.

None yet

4 participants