haskell - cabal 测试包安装期间随机 Word8 重复实例声明

标签 haskell cabal cabal-install hunit

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

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

最佳答案

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

孤儿实例的几个问题之一是定义类或类型的包之一可能会选择在更高版本中添加该实例本身,这正是 >random 包在本例中已完成,因此实例发生冲突。

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

关于haskell - cabal 测试包安装期间随机 Word8 重复实例声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26636110/

相关文章:

在 Haskell 中循环 Unboxed 数组的性能

haskell - `seq` 部分应用函数

haskell - cabal的 "Warning: Falling back to topdown solver for GHC < 7."是什么意思?

haskell - 限制 cabal 安装使用的内存?

haskell - 使用类型族和泛型查找 Id 值

Haskell:具有幻像变量的数据的异构列表

haskell - 未找到堆栈初始化包

Haskell cabal 构建 undefined reference 错误并重复重新编译

haskell - Cabal 和 HPC 以及运行代码覆盖率测试时的错误

haskell - Cabal 在 ubuntu 12.04 上安装reactive-banana-wx