使用cabal,我尝试在Haskell Platform 2012.2.0.0 (Windows XP)上安装acid-state,但得到以下错误:
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发布于 2012-11-08 00:37:12
在使用可扩展异常系统时,这类问题经常出现。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/目录中的一些模块,它们在任何情况下都是一个很好的教程。如果你有更多的麻烦回信,我们可以一起设计一个合适的补丁文件。
https://stackoverflow.com/questions/13260622
复制相似问题