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
ghc 9 support #70
ghc 9 support #70
Conversation
now I'm getting this error: [18 of 31] Compiling Polysemy.ConstraintAbsorber.MonadCont
/home/theo/prj/polysemy-zoo/src/Polysemy/ConstraintAbsorber/MonadCont.hs:31:14: error:
* Couldn't match type: forall b1. a1 -> Sem r b1
with: a1 -> Sem r b
Expected: ((a1 -> Sem r b) -> Sem r a1) -> Sem r a1
Actual: ((forall b. a1 -> Sem r b) -> Sem r a1) -> Sem r a1
* In the first argument of `ContDict', namely `(callCC @ref)'
In the third argument of `absorbWithSem', namely
`(ContDict (callCC @ref))'
In the expression:
absorbWithSem
@C.MonadCont @Action (ContDict (callCC @ref)) (Sub Dict)
* Relevant bindings include
absorbCont :: (C.MonadCont (Sem r) => Sem r a) -> Sem r a
(bound at src/Polysemy/ConstraintAbsorber/MonadCont.hs:30:1)
|
31 | (ContDict (callCC @ref))
| ^^^^^^^^^^^ |
the new error seems to be related to #66 |
could have something to do with the minor changes to type variable quantification in ghc 9 (I don't see how though...) Are we sure that the current version compiled before ghc 9? |
The new error is definitely a victim of the loss of function contravariance. Violent eta-expansion should fix it. (ContDict (\main -> callCC @ref $ \exit -> main exit)) maybe even this is required: (ContDict (\main -> callCC @ref $ \exit -> main $ \a -> exit a)) |
caused by ghc proposal 287
now builds with ghc 9 for me |
I inlined
absorbMonadCatch
and changed the type application which fixed #69.Should probably still look into if/why this is necessary.