开发者

Ambiguous module name `Prelude'

I get this when i want to recompile xmonad to change the configuration:

Implicit import declaration:
    Ambiguous module name `Prelude':
      it was found in multiple packages: base haskell98-2.0.0.0

Xmonad was installed via pacman. When i got this error i removed xmonad from pacman and then trie开发者_运维技巧d to cabal install xmonad. I got the above error again but i was able to solve it by removing haskell98 from the cabal file.

Now i want to reconfigure xmonad with MOD-Q the error reappears and i have no clue how to fix this. Any help appreciated.

I use GHC version 7.0.3 (from Haskell platform)


Try this:

ghc-pkg hide haskell98


In my case hiding haskell98 unfortunately was insufficient, I had to remove the obsolete haskell98 from the build-depends list in my .cabal build file (keeping the base >= 4 of course). It read before:

build-depends:  
    base >= 4,
    haskell98

... and then ...

build-depends:  
    base >= 4

With that the error message "Ambiguous module name `Prelude'" above disappeared.


See this GHC bug ticket on the same subject:

GHC starting with version 7.2.1 will not support using the haskell98 package and the base package at the same time. The haskell-src package has both of these in its build-depends, so it will need to be modified. Most of the time, what you want to do is remove haskell98 from build-depends, and fix up any imports of Haskell 98 modules to point to their base equivalents.

The bug ticket was closed (without a fix), and the original filer responded:

Yes, removing haskell98 from .cabal file seems to have fixed it - it did compile without errors. It looks like it didn't have any imports to haskell98, because according to comment in .cabal file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜