ddssff / cabal-debian

Create a Debianization by examining a .cabal file.
Other
16 stars 10 forks source link

Strange error when building with GHC-7.6 - anyone have this installed who can investigate? #33

Closed ddssff closed 9 years ago

ddssff commented 9 years ago

This error occurs in a file with Rank2Types set in the header:

src/Debian/Debianize/Options.hs:223:11:
    Illegal polymorphic or qualified type: Lens DebInfo Relations
    Perhaps you intended to use -XRankNTypes or -XRank2Types
    In the type signature for `addDep':
      addDep :: Monad m =>
            (BinPkgName -> Lens DebInfo Relations) -> String -> CabalT m ()

Here is the build: https://travis-ci.org/ddssff/cabal-debian/jobs/50780350

nomeata commented 9 years ago

Lens is just a type synonym:

type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t

so by putting that inside a function argument, you have created a higher order type. Simply add {-# LANGUAGE RankNTypes #-} to the top of the file.

ddssff commented 9 years ago

What I should have mentioned is that I already have Rank2Types in that file!

ddssff commented 9 years ago

I changed Rank2Types to RankNTypes and this fixed it.