1

Using cabal, I tried to install acid-state on Haskell Platform 2012.2.0.0 (Windows XP) but got the following error:

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
Matvey Aksenov
  • 3,802
  • 3
  • 23
  • 45
user1023733
  • 805
  • 5
  • 14
  • 1
    possible duplicate of [How can I get cabal to install acid-state?](http://stackoverflow.com/questions/12416201/how-can-i-get-cabal-to-install-acid-state) – Daniel Fischer Nov 06 '12 at 23:18
  • Workaround: install an older `acid-state`, `cabal install acid-state-0.7.0`. – Daniel Fischer Nov 06 '12 at 23:19
  • 1
    Have you tried out the new Haskell Platform? 2012.4 came out a day ago. – David Nov 06 '12 at 23:35
  • This is not a question, but a bug report. Please contact the maintainer to report the bug. The hackage page gives the contact address : http://hackage.haskell.org/package/acid-state . By the way, I am pretty sure the maintainer does not use Windows himself, so offering help on this OS would be even more welcome than the raw bug report. – Paul R Nov 07 '12 at 16:23

1 Answers1

1

This sort of trouble frequently arises when going over to the extensible exceptions system. tryE and catchIO are standard boilerplate; they just specialize catch and try to use SomeException and 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

So do cabal unpack acid-state, and replace src-win32/FileIO.hs with this, which defines them on lines 18ff https://gist.github.com/4032603 And then do cabal install from the outer directory, the one with the acid-state.cabal file.

There's probably some additional mistake, since I cant test it at the moment. As Paul R. says, when you get it to compile, send it to the maintainers. The package is heavily maintained, but it looks like they are in need of a Windows tester. Acid-state is certainly worth the trouble. You should also try some of the modules in the examples/ directory, which make an excellent tutorial in any case. If you have more troubles write back, we can devise a suitable patched file together.

applicative
  • 8,081
  • 35
  • 38