使用阴谋集团,我试图在Haskell平台2012.2.0.0(Windows XP)上安装酸态,但得到以下错误:
src-win32FileIO.hs:43:5:
Not in scope: catchIO Perhaps you meant `catch' (imported from Prelude)
src-win32FileIO.hs:55:6:
Not in scope: tryE Perhaps you meant `try' (imported from Control.Exception.Extensible)
src-win32FileIO.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
在转到可扩展异常系统时经常会出现这种麻烦。tryE
和catchIO
是标准样板;他们只是专门catch
和try
使用SomeException
和IOException
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
,并将src-win32/FileIO.hs替换为this,它在第18ff行 https://gist.github.com/4032603 上定义它们,然后从外部目录(带有acid-state.cabal
文件的目录)执行cabal install
。
可能还有一些额外的错误,因为我目前无法测试它。正如Paul R.所说,当你编译它时,把它发送给维护者。该软件包得到了大量维护,但看起来他们需要一个Windows测试人员。酸态当然值得麻烦。您还应该尝试 examples/目录中的一些模块,这些模块在任何情况下都是一个优秀的教程。如果您有更多的麻烦回信,我们可以一起设计一个合适的修补文件。