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

Support ghc 9.6 #156

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Support ghc 9.6 #156

merged 1 commit into from
Jul 2, 2024

Conversation

edsko
Copy link
Collaborator

@edsko edsko commented May 30, 2024

This supersedes both #151 and #155.

This mostly deals with the usual churn betweenghc versions (and relaxes other package bounds), but there was one non-trivial change. The large-anon plugin was generating code that looked something like this:

... unsafeCoerce @(Show Bool) @(Show Any) evidence ...

In ghc >= 9.6 this no longer works, because Show Bool :: Constraint, and the type arguments of unsafeCoerce have kind Type, and Type and Constraint are no longer the same thing in core starting in 9.6. We therefore now go through an indirection using Dict, so that the above code becomes

... fromDict (unsafeCoerce @(Dict Show Bool) @(Dict Show Any) (Dict evidence)) ...

This nearly resolves the problem, except that for some reason I also had to mark evidenceAllFields in Data.Record.Anon.Plugin.Internal.Runtime as NOINLINE, otherwise we still get -dcore-lint errors, but only with -O1. This almost feels like a ghc bug, but I don't have time to investigate this further at this point.

@TristanCacqueray and @gbrsales, I have combined your work and my own changes into this one commit. I've listed both of you in the git commit as Co-authored-by, and also listed you where appropriate in the ChangeLog.md entries. I hope that's okay.

This was referenced May 30, 2024
Co-authored-by: Tristan Cacqueray <[email protected]>
Co-authored-by: Gabriele Sales <[email protected]>
@edsko edsko merged commit 0ffd1fc into main Jul 2, 2024
4 checks passed
@edsko edsko deleted the edsko/ghc-9.6 branch July 2, 2024 09:36
@TristanCacqueray
Copy link
Contributor

Thank you @edsko !

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.

2 participants