[Haskell-cafe] How to catch all exceptions that could be caught?

Magicloud Magiclouds magicloud.magiclouds at gmail.com
Thu Jan 12 04:03:34 CET 2012


Hi,
  With Prelude.catch, I could write "catch () $ \_ -> return Nothing".
But with Control.Exception.catch, I must specify a type for the "_".
What should I do?

PS: In Java document, a function declaration would tell us both the
incoming args and outgoing, AND what exceptions would it throw. But it
does not seem to exist in Haskell document? And the most awful part is
that even when the program failed with error message, I still did not
know what exception was this. Take "recv: does not exist (Connection
refused)" for example.
-- 
竹密岂妨流水过
山高哪阻野云飞



More information about the Haskell-Cafe mailing list