ekmett / kan-extensions

Kan extensions, Kan lifts, the Yoneda lemma, and (co)monads generated by a functor
Other
79 stars 33 forks source link

Build fails on GHC 7.7 without ImpredicativeTypes #1

Closed russetkoala closed 9 years ago

russetkoala commented 11 years ago
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.7.20130625
$ cabal install kan-extensions
Resolving dependencies...
Configuring kan-extensions-3.6...
Building kan-extensions-3.6...
Preprocessing library kan-extensions-3.6...
[ 1 of 10] Compiling Data.Functor.Yoneda.Reduction ( src/Data/Functor/Yoneda/Reduction.hs, dist/build/Data/Functor/Yoneda/Reduction.o )
[ 2 of 10] Compiling Data.Functor.Yoneda ( src/Data/Functor/Yoneda.hs, dist/build/Data/Functor/Yoneda.o )

src/Data/Functor/Yoneda.hs:81:11: Warning:
    Rule "lower/lift=id" may never fire because ‛.’ might inline first
    Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‛.’

src/Data/Functor/Yoneda.hs:82:11: Warning:
    Rule "lift/lower=id" may never fire because ‛.’ might inline first
    Probable fix: add an INLINE[n] or NOINLINE[n] pragma on ‛.’
[ 3 of 10] Compiling Data.Functor.Kan.Rift ( src/Data/Functor/Kan/Rift.hs, dist/build/Data/Functor/Kan/Rift.o )
[ 4 of 10] Compiling Data.Functor.Kan.Lift ( src/Data/Functor/Kan/Lift.hs, dist/build/Data/Functor/Kan/Lift.o )

src/Data/Functor/Kan/Lift.hs:51:27:
    Cannot instantiate unification variable ‛a0’
    with a type involving foralls: forall x. h x -> g (z x)
      Perhaps you want -XImpredicativeTypes
    In the first argument of ‛Lift’, namely ‛(fmap f . g)’
    In the expression: Lift (fmap f . g)
    In an equation for ‛fmap’: fmap f (Lift g) = Lift (fmap f . g)

src/Data/Functor/Kan/Lift.hs:51:36:
    Cannot instantiate unification variable ‛a0’
    with a type involving foralls: forall x. h x -> g (z x)
      Perhaps you want -XImpredicativeTypes
    In the second argument of ‛(.)’, namely ‛g’
    In the first argument of ‛Lift’, namely ‛(fmap f . g)’

src/Data/Functor/Kan/Lift.hs:67:10:
    Cannot instantiate unification variable ‛b0’
    with a type involving foralls: forall a. f a -> g (z a)
      Perhaps you want -XImpredicativeTypes
    In the expression: flip runLift
    In an equation for ‛toLift’: toLift = flip runLift

src/Data/Functor/Kan/Lift.hs:67:15:
    Cannot instantiate unification variable ‛b0’
    with a type involving foralls: forall x. f x -> g (z x)
      Perhaps you want -XImpredicativeTypes
    In the first argument of ‛flip’, namely ‛runLift’
    In the expression: flip runLift
Failed to install kan-extensions-3.6
cabal: Error: some packages failed to install:
kan-extensions-3.6 failed during the building phase. The exception was:
ExitFailure 1

Adding {-# LANGUAGE ImpredicativeTypes #-} to Lift.hs makes it build successfully, but I am leery of this extension, having been bitten by it in the past.

michaelt commented 10 years ago

Oh, I somehow failed to see this since I was approaching it in the web interface as a patch https://github.com/ekmett/kan-extensions/pull/7 It seems simple enough to resolve without following GHC's advice about -XImpredicativeTypes (though I can't say I've meditated on Data.Functor.Lift.Kan.) Not sure how we can wake up edwardk to notice.

glguy commented 9 years ago

I believe that this is no longer an issue. Please reopen it with new information if a released version of GHC is failing to build things.