2014-10-29 37 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