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

ghc 9 support #70

Merged
merged 3 commits into from Jun 6, 2021
Merged

ghc 9 support #70

merged 3 commits into from Jun 6, 2021

Conversation

funketh
Copy link
Contributor

@funketh funketh commented Jun 5, 2021

I inlined absorbMonadCatch and changed the type application which fixed #69.
Should probably still look into if/why this is necessary.

@funketh
Copy link
Contributor Author

funketh commented Jun 5, 2021

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))
   |              ^^^^^^^^^^^

@funketh
Copy link
Contributor Author

funketh commented Jun 6, 2021

the new error seems to be related to #66

@funketh
Copy link
Contributor Author

funketh commented Jun 6, 2021

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)

@KingoftheHomeless
Copy link
Collaborator

KingoftheHomeless commented Jun 6, 2021

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))

@funketh funketh marked this pull request as ready for review June 6, 2021 15:35
@funketh
Copy link
Contributor Author

funketh commented Jun 6, 2021

now builds with ghc 9 for me

@KingoftheHomeless KingoftheHomeless merged commit 1eed0f8 into polysemy-research:master Jun 6, 2021
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.

ghc 9 - Couldn't match MonadCatch with MonadThrow
2 participants