On Wed, 10 Jun 1998, Simon L Peyton Jones wrote:

 | We're implementing an experimental version of this
 | in GHC, integrated with the IO monad exceptions, so that
 | 
 |   handle :: (IOError -> IO a) -> IO a -> IO a
 | 
 | and we add an extra constructor (UserError String) to the
 | IOError type for exceptions raised by raise.

How about adding the following errors:

  data IOError
    = ...
    | HeapOverflowError
    | StackOverflowError

This is very useful when you for example want to implement a Hugs like
system in Haskell.

Now your Haskell programs will be very unlikely to crash!

Another question: Is "handle" strict in the following argument:

  handle :: (IOError -> IO a) -> IO a -> IO a
                                    ^
(meaning: will "handle f (return bottom)" be bottom?)

Regards,
Koen.

--
Koen Claessen,
[EMAIL PROTECTED],
http://www.cs.chalmers.se/~koen,
Chalmers University of Technology.


Reply via email to