2012-11-06 51 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 /目录中的一些模块,这些模块在任何情况下都是非常好的教程。如果您有更多的麻烦回复,我们可以一起设计一个合适的补丁文件。