Closed funketh closed 3 years ago
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?
(I'm getting a ghc panic with the repo's stack.yaml
, will have to try a different snapshot)
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))
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.