-
Notifications
You must be signed in to change notification settings - Fork 164
Add PolyKinds
as default extension to clash-prelude
#2994
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
PolyKinds
to as default extension to clash-prelude
PolyKinds
as default extension to clash-prelude
Because I intend this to be a separate PR and now the commit history in the GUI reflects that. If you agree with the last PR. shall we just close this one and squash + merge that one? |
Ah, I never considered merging PR #2933 as-is, adding My preference would be to close the other PR and include all the changes here. But if you don't want to do that, I am not against merging first #2933 and then this. However, there's one last thing to address in #2933. Again, I'm sorry I missed that one on initial review, I mentally corrected it to what I expected it to say. [edit]
I don't really understand what you're going for here, though. I don't think #2933 should be squashed, I thought the three commits were deliberate. And if you close this one, you still have to make a new PR that does what this one does? I feel like we're probably miscommunicating :-D I'm probably interpreting it completely wrong. |
56185a1
to
3b71c58
Compare
a2ca9ab
to
7bafd7a
Compare
I removed a superfluous change to |
7bafd7a
to
6b90f8f
Compare
Corrected a typo in the first commit message (and formatted the |
Ah, it would appear that CI hasn't been passing all along. From a single glance, I think some tests define their own [edit] instance BitPack (Proxy a) => BitPack (Proxy a) but stopped working when this was changed to instance BitPack (Proxy a) maybe? |
Nah, that was a red herring. I'm thinking: by enabling
|
@lmbollen: AFAICT your changes to
@DigitalBrains1: By now I'm pretty convinced code like T1242 is "wrong". You shouldn't make instances of the form "any type that takes X as an argument", as this removes the "agency" of specific types defining what their instance behavior should look like. I can make a more precise argument, but I hope this vague description already convinces you. |
It does :-) |
02d6979
to
f26d4db
Compare
05bbc47
to
ed9b095
Compare
Why the heck does the test suite succeed on older GHC's even though you use Also, I doubt this is actually still testing the regression. With some mucking about, I managed to run the original and new tests on the parent of the commit that introduced the fix (5477a2f) and the new test does not error. |
Yep, just a warning. We might want to make this an error, it might seriously affect the integrity of the regression tests on older GHC's:
|
Prevents accidental `{-# OPAQUE f #-}`s from slipping by
ed9b095
to
062c6ac
Compare
`NoPolyKinds` has confused us multiple times because it would needlessly constrain instances to `SomeClass (t :: Type)` instead of the more general `SomeClass (t :: k)`. See the changelog in this commit for more information. This also greatly simplifies the reproducer for #1242, as we couldn't get the behavior we wanted with a local `BitPack` definition -- necessary because instances such as the ones in T1242 are not possible anymore. The current code in T1242 is built to make sure Clash sees an unresolved type family which it *has* to resolve in order to produce HDL. The reproducer was tested by manually reverting the patch for #1242.
062c6ac
to
a2f6777
Compare
Alright, what a ride. I've:
I think this is good, but I'll wait a few days for it to attract more comments. |
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.
Here, have another aproval
Nice work untangling everything!
PolyKinds
is now adefault-extension
ofclash-prelude
.NoPolyKinds
prevented the derivation oftypeclass instances of types that contained a Kind, for example
BitPack (Proxy 52)
.This should also be backported to 1.8We can't backport this to 1.8, as it is a change that makes some (shoddy) code not compile anymore.Still TODO: