-
Notifications
You must be signed in to change notification settings - Fork 70
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 GHC-97044 #445
Document GHC-97044 #445
Conversation
This restriction applies to the following type classes: | ||
|
||
- [Coercible](https://hackage.haskell.org/package/base/docs/Data-Coerce.html#t:Coercible) - This class does not have regular instances; instead they are created on-the-fly during type-checking. | ||
- [HasField](https://hackage.haskell.org/package/base/docs/GHC-Records.html#t:HasField) - This class is used by [OverloadedRecordDot](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/overloaded_record_dot.html) and related extensions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least for the HasField
typeclass it is possible to create user-written instances. See for example my library here: https://github.com/BinderDavid/tuple-fields/blob/main/src/Data/Tuple/Fields.hs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Seems like I was misled by browsing around GHC codebase and I interpreted this
to mean that HasField can also trigger this warning.
But after deeper look it seems to be related to other "validations" done on instances of this type class.
As for other typeclasses mentioned, I'm pretty sure they should be there as I saw them mentioned in warnings in ghc test suite: https://github.com/search?q=repo%3Aghc%2Fghc%2097044&type=code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I have one suggested change in grammar, and I think the HasField
typeclass does not belong in that list.
No description provided.