使用cabal,我尝试在Haskell Platform 2012.2.0.0(Windows XP)上安装了酸状态,但是出现了以下错误:
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
答案 0 :(得分: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
,并用this替换src-win32 / FileIO.hs,它在第18ff行https://gist.github.com/4032603上定义它们然后从外部目录执行cabal install
,带有acid-state.cabal
文件的那个。
可能还有一些额外的错误,因为我现在无法测试它。正如Paul R.所说,当你编译它时,将其发送给维护者。该软件包维护得很多,但看起来他们需要Windows测试人员。酸态肯定是值得的。您还应该尝试examples /目录中的一些模块,这些模块在任何情况下都是一个很好的教程。如果你有更多麻烦回写,我们可以一起设计一个合适的补丁文件。