I'm probably doing something wrong but this example doesn't compile for
me under ghc 6.10.1
(http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Exception.html#4):
catch (openFile f ReadMode)
(\e - hPutStr stderr (Couldn't open ++f++: ++ show e))
Run.hs:77:24:
CE.catch :: (CE.Exception e) = IO a - (e - IO a) - IO a
foo d = CE.catch (openFile d ReadMode return ())
(\e - hPutStr stderr (Couldn't open ++ d ++: ++ show e))
btw, if your handler cannot return the same type as your action, is this
the right place to catch the
Claus Reinke wrote:
btw, if your handler cannot return the same type as your action, is this
the right place to catch the exceptions?
That was an example, the real code looks something like this:
do d - getCurrentDirectory
t - getCurrentTime
let u = asn1c. ++ show (utctDay