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

Use withDict to implement bindIP on recent GHCs #166

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

RyanGlScott
Copy link
Collaborator

Instead of unsafeCoerce, we can use the more recent withDict primitive from GHC.Exts. Among other benefits, this is more likely to be future-proof against possible changes to GHC's representation of "newtype classes" in the future.

Fixes #165.

@RyanGlScott
Copy link
Collaborator Author

I decided to try and tackle reflection's uses of unsafeCoerce after this, at which point I discovered that replacing unsafeCoerce with withDict broke reflection's test suite. See GHC#21575. As a result, I'm going to mark this PR as a draft and wait for a resolution to that issue before proceeding.

@RyanGlScott RyanGlScott marked this pull request as draft May 14, 2022 13:54
Instead of `unsafeCoerce`, we can use the more recent `withDict` primitive
from `GHC.Exts`. Among other benefits, this is more likely to be future-proof
against possible changes to GHC's representation of "newtype classes" in the
future.

Fixes #165.
@RyanGlScott
Copy link
Collaborator Author

GHC#21575 is still not completely fixed as of GHC 9.4.1, so I think it's best to hold off on this.

@RyanGlScott RyanGlScott mentioned this pull request Aug 8, 2022
4 tasks
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.

Use withDict instead of unsafeCoerce to implement bindIP
1 participant