2

失败时以下错误消息是什么意思cabal install testpack-2.1.1

... 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

我试过谷歌搜索,但无法理解这个安装错误。

4

1 回答 1

2

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

孤立实例的几个问题之一是定义类或类型的包之一可能会选择在以后的版本中自己添加该实例,这正是random包在这种情况下所做的,因此实例冲突.

testpack版本开始2.1.2,有一个检查确保仅在random包太旧而无法自己定义实例时才定义实例。因此,您应该能够通过安装更高版本的来解决此问题testpack

于 2014-10-29T17:59:07.947 回答