blackholes and exception handling
igloo at earth.li
Sun May 2 06:31:44 EDT 2010
On Sun, May 02, 2010 at 12:10:23AM +0200, Sebastian Fischer wrote:
> although, don't_launch_first is a non-terminating computation. Without
> black-hole detection this code would never 'launch missiles'.
> Is the above output intended?
> go_ahead :: SomeException -> IO ()
> go_ahead _ = putStr "go ahead, "
Note that catching all exceptions is rarely the right thing to do. See
for more details.
> The idea behind black-hole detection is that one bottom is as good as
> another . Consequently, exception handling may not distinguish
> between non-termination and other errors.
Pure code can't distinguish, but exception handling code in IO can.
More information about the Glasgow-haskell-users