2012-11-06 52 views
1

使用cabal,我試圖在Haskell平臺2012.2.0.0(Windows XP)上安裝酸性狀態,但得到以下錯誤:Haskell平臺2012.2.0.0(Windows XP)無法cabal安裝酸狀態

src-win32\FileIO.hs:43:5: 
    Not in scope: catchIO Perhaps you meant `catch' (imported from Prelude) 

src-win32\FileIO.hs:55:6: 
    Not in scope: tryE Perhaps you meant `try' (imported from Control.Exception.Extensible) 

src-win32\FileIO.hs:56:6: 
    Not in scope: tryE 
    Perhaps you meant `try' (imported from Control.Exception.Extensible) 
cabal: Error: some packages failed to install: 
acid-state-0.8.1 failed during the building phase. The exception was: 
ExitFailure 1 
+1

可能重複[如何獲得cabal安裝酸性狀態?](http://stackoverflow.com/questions/12416201/how-can-i-get-cabal-to-install-acid-state) –

+0

解決方法:安裝一個較舊的'acid-state','cabal install acid-state-0.7.0'。 –

+1

您是否嘗試過新的Haskell平臺? 2012.4發佈前一天。 – David

回答

1

當轉到可擴展異常系統時,這種麻煩經常出現。 tryEcatchIO是標準樣板;他們只是專注catchtry使用SomeExceptionIOException

import Control.Exception.Extensible(try,throw) 
import Control.Exception(SomeException,IOException) 
import qualified Control.Exception as E 
tryE :: IO a -> IO (Either SomeException a) 
tryE = try 
catchIO :: IO a -> (IOException -> IO a) -> IO a 
catchIO = E.catch 

所以做cabal unpack acid-state,並與this取代SRC-的Win32/FileIO.hs,這將它們定義上線18FF https://gist.github.com/4032603然後從外目錄做cabal install,與acid-state.cabal文件。

可能還有一些額外的錯誤,因爲此刻我無法測試它。正如Paul R.所說,當你編譯它時,將它發送給維護者。該軟件包經過嚴格維護,但看起來他們需要Windows測試人員。酸狀當然是值得的麻煩。你也應該嘗試examples /目錄中的一些模塊,這些模塊在任何情況下都是非常好的教程。如果您有更多的麻煩回覆,我們可以一起設計一個合適的補丁文件。