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.

-Ross


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.

Cheers,
David

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to