At 14:40 1998-06-10 +0100, you wrote:

>Here's a reasonable design for exceptions in Haskell:

>* handle :: (String -> IO a) -> IO a -> IO a

You probably realized more quickly than I how this
can leak exceptions.  What I mean is

main = do quotient <- handle (const (return 0)) (return (0 / 0)
                         -- Looks plausible
                         -- but the exception isn't raised yet.
          print quotient -- Here the expression 0/0 is evaluated
                         -- and the exception is raised with no handler.

Is this considered a drawback?

--
Scott Turner
[EMAIL PROTECTED]       http://www.ma.ultranet.com/~pkturner


Reply via email to