ekmett / profunctors

Haskell 98 Profunctors
http://hackage.haskell.org/package/profunctors
Other
70 stars 43 forks source link

GHC9 issue #96

Closed sorki closed 3 years ago

sorki commented 3 years ago

I've managed to hit this fun one trying to build profunctors with GHC9:

src/Data/Profunctor/Strong.hs:188:12: error:
    • Couldn't match type: Tambara p (a, c) (b, c)
                     with: forall c1. Tambara p (a, c1) (b, c1)
      Expected: Tambara (Tambara p) a b -> Tambara p (a, c) (b, c)
        Actual: Tambara (Tambara p) a b
                -> forall c. Tambara p (a, c) (b, c)
    • In the first argument of ‘(.)’, namely ‘runTambara’
      In the expression: runTambara . produplicate
      In an equation for ‘first'’: first' = runTambara . produplicate
    • Relevant bindings include
        first' :: Tambara p a b -> Tambara p (a, c) (b, c)
          (bound at src/Data/Profunctor/Strong.hs:188:3)
    |
188 |   first' = runTambara . produplicate
    |            ^^^^^^^^^^

src/Data/Profunctor/Strong.hs:428:13: error:
    • Couldn't match type: p a0 b0 -> Cotambara q a0 b0
                     with: forall a b. p a b -> Cotambara q a b
      Expected: (p :-> q) -> p :-> Cotambara q
        Actual: (p :-> q) -> p a0 b0 -> Cotambara q a0 b0
    • In the expression: Cotambara
      In an equation for ‘cotambara’: cotambara = Cotambara
    • Relevant bindings include
        cotambara :: (p :-> q) -> p :-> Cotambara q
          (bound at src/Data/Profunctor/Strong.hs:428:1)
    |
428 | cotambara = Cotambara

Migration guide contains couple of changes related to (nested) foralls: https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0

I'm not yet sure how to fix this, suggestions welcome.

RyanGlScott commented 3 years ago

What version of profunctors are you building? As noted in the CHANGELOG, profunctors-5.6 and later should compile with GHC 9.0.

sorki commented 3 years ago

Oh I'm indeed on 5.5.2. Thank you!