Re: blackholes and exception handling

2010-05-02 Thread Simon Marlow
On 02/05/10 12:10, Sebastian Fischer wrote: Is the above output intended? Yes. Interesting. Note that catching all exceptions is rarely the right thing to do. See http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#4 for more details. I should have w

Re: blackholes and exception handling

2010-05-02 Thread Felipe Lessa
On Sun, May 02, 2010 at 01:10:17PM +0200, Sebastian Fischer wrote: > What makes me wary is that GHC distinguishes between different kinds > of non-terminating computations (those it can detect as black holes > and those it can't). As a consequence, the semantics of my program > depends on how I def

Re: blackholes and exception handling

2010-05-02 Thread Sebastian Fischer
Is the above output intended? Yes. Interesting. Note that catching all exceptions is rarely the right thing to do. See http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#4 for more details. I should have written go_ahead :: NonTermination ->

Re: blackholes and exception handling

2010-05-02 Thread Ian Lynagh
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? Yes. > go_ahead :: SomeException -> IO () > go

blackholes and exception handling

2010-05-01 Thread Sebastian Fischer
Hello, GHC can spot (some) non-terminating computations and terminate with blackhole: <> instead of running indefinitely. With exception handling one can handle such situations. The following program 'launches missiles': import Control.Exception main = do handle go_ahead don't_