[Haskell-cafe] Extensible Exceptions
huschi at gmx.org
Sun Nov 23 11:43:11 EST 2008
BTW, the documentation of catch is bad: the example
catch (openFile f ReadMode)
(\e -> hPutStr stderr ("Couldn't open "++f++": " ++ show e))
does not type check. Is this a known "bug" or shall I report it anywhere?
Ross Mellgren schrieb:
> I think catch is now basically what catchJust was -- you can just do
> > thing_to_try `catch` (\ (ErrorCall s) -> putStrLn s)
> and it will only catch ErrorCall exceptions.
> David F. Place wrote:
>> Hi, All.
>> I am trying to understand the new exceptions package in base-4
>> Control.Exceptions. The documentation for catchJust is the same as in
>> Control.OldException including this example:
>> result <- catchJust errorCalls thing_to_try handler
>> Control.OldException provides the predicate errorCalls, but the new one
>> does not. I don't see how to write it.
>> Thanks for reading.
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe