-
Notifications
You must be signed in to change notification settings - Fork 569
Remove old generics and generics-rep record support #3007
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
I was expecting that we wouldn't derive |
Also, this seems fairly significant, so I think it might be sensible to call the first release containing this v0.12.0, just in case we later notice some problem with it which we want to fix, but fixing it requires another breaking change. |
Yes, sorry I meant we should write instances for those. And yes, I think we do need a 0.12.0 release separate from 1.0.0 at this point. |
Is there anything stopping us from writing those instances now, and releasing updated core libraries with those instances, so that people can use them with the 0.11.x compiler? |
Yes, we'd need to move |
Fixes #2911. |
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.
Would it make sense to add a test which ensures that code which attempts to derive an old-style Generic
instance fails with the correct error? I suppose we probably have a test for that already.
@hdgarrood Done, thanks! I'll merge once CI passes. |
Would it be possible to add a |
How would it work? The compiler won't derive instances for records any more, so the issue is not that we don't want an instance to exist, but that we want other instances to exist (e.g. |
I see. What sort of message do you get when you try to derive now? |
|
What's the official way of migrating old |
You could try using this code. If it doesn't get merged, I'll probably close the PR and make a |
Got it, thanks @paf31. One question, out of curiosity though: a comment on that PR states that "For standard data structures, you can simply write |
I may have copied that incorrectly from the original docs 😄 |
Ok, got it. |
This removes
generic
deriving mechanismgenerics-rep
It needs some changes to
generics-rep
, and we'd probably want to deprecategenerics
too.This is breaking, so it would go into 1.0 or 0.12.0.
Finally, this means we need to figure out how to derive
Eq
,Show
,Ord
, etc. for records usingRowToList
, which means moving some things around in the core libraries.