2014-10-29 38 views
2

期间重复实例声明是什么时候cabal install testpack-2.1.1失败以下错误消息意味着:随机Word8阴谋testpack安装

... Everything above this succeeded with no problems. 
[22 of 22] Compiling Control.Monad.Cont (Control/Monad/Cont.hs, dist/build/Control/Monad/Cont.o) 
Registering mtl-2.2.1... 
Installing library in /home/ely/.cabal/lib/mtl-2.2.1/ghc-7.4.2 
Registering mtl-2.2.1... 
Downloading testpack-2.1.1... 
Configuring testpack-2.1.1... 
Building testpack-2.1.1... 
Preprocessing library testpack-2.1.1... 
[1 of 3] Compiling Test.QuickCheck.Instances (src/Test/QuickCheck/Instances.hs, dist/build/Test/QuickCheck/Instances.o) 

src/Test/QuickCheck/Instances.hs:50:10: 
    Duplicate instance declarations: 
     instance Random Word8 
     -- Defined at src/Test/QuickCheck/Instances.hs:50:10 
     instance Random Word8 -- Defined in `System.Random' 
cabal: Error: some packages failed to install: 
testpack-2.1.1 failed during the building phase. The exception was: 
ExitFailure 1 

我尝试过谷歌搜索,但不能使这种安装错误的感觉。

回答

2

testpack-2.1.1Random Word8提供了一个所谓的孤儿实例,即它没有定义类或类型本身的实例。

之一几个问题孤儿情况是,包其定义类或类型的一个可能选择添加实例自己在以后的版本,这也恰恰是random包在这做情况,所以实例冲突。

testpack版本2.1.2有一个检查,确保只有在random软件包已老化而无法自行完成时才定义实例。因此,您应该可以通过安装更高版本的testpack来解决此问题。

+0

我会对此工作,但是'cabal install testpack-2.1.2'的快速尝试几乎立即给出了这个错误:'src/Test/QuickCheck/Tools.hs:34:34:'interrupted'不是一个(可见)字段的构造函数'MkResult'' – ely 2014-10-29 19:16:23

+0

@EMS Sheesh。无论如何,我自己试过'cabal install testpack',它只安装了一些警告2.1.2.1。然后我意识到我应该完成'cabal update',然后在试图安装2.1.3.0时出错。有些东西告诉我,该软件包的版本边界没有写得很好:( – 2014-10-29 19:31:16