当我尝试使用命令"cabal install yesod"安装yesod时,我收到以下错误:
cabal install rsa
Resolving dependencies...
Configuring RSA-1.0.6.1...
Preprocessing library RSA-1.0.6.1...
Preprocessing executables for RSA-1.0.6.1...
Building RSA-1.0.6.1...
[1 of 1] Compiling Codec.Crypto.RSA ( Codec/Crypto/RSA.hs, dist/build/Codec/Crypto/RSA.o )
Codec/Crypto/RSA.hs:577:10:
Duplicate instance declarations:
instance Random Word8 -- Defined at Codec/Crypto/RSA.hs:577:10-21
instance Random Word8 -- Defined in System.Random
cabal: Error: some packages failed to install:
Run Code Online (Sandbox Code Playgroud)
似乎RSA lib与另一个库冲突.
任何的想法?
我的环境:Mac OS X 10.7 GHC 7.0.3
提前致谢.
该random软件包开始在1.0.1.0版中导出新实例.一种解决方案是仅在random包是该版本或更高版本时有条件地编译RSA库的实例; 这样的一些变化应该有效:
{-# LANGUAGE CPP #-}
#if MIN_VERSION_random(1,0,1)
#else
instance Random Word8 where
...
#endif
Run Code Online (Sandbox Code Playgroud)
如果您向RSA库的维护者发送补丁,则可获得奖励积分.
或者,您可以要求cabal使用旧版本random.