
On 11 April 2006 13:35, John Meacham wrote:
On Tue, Apr 11, 2006 at 01:24:07PM +0100, Simon Marlow wrote:
Attached is another variant of the extensible exceptions idea, it improves on the previous designs in a couple of ways: there's only one catch & throw, regardless of what type you're throwing or catching. There is an extensible hierarchy of exceptions, and you can catch and re-throw subclasses of exceptions.
I made the catch and throw separate so the decision as to whether to include imprecice exceptions and extensible extensions can be made independently.
that and
throw x /= ioError x
ioError x >> return () -> IO _|_ (only _|_ when IO action executed) throw x >> return () -> _|_
ioError x `seq` () -> () throw x `seq` () -> _|_
yes, when I say "one throw" I was referring to the argument type, not the return type. We should still have ioError - although it would probably be better named throwIO: http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Excep tion.html#v%3AthrowIO (the docs for throwIO also mention the strictness property you described above) Cheers, Simon

On Tue, Apr 11, 2006 at 01:43:18PM +0100, Simon Marlow wrote:
yes, when I say "one throw" I was referring to the argument type, not the return type. We should still have ioError - although it would probably be better named throwIO:
Ah, I see what you mean now. would it be possible to use Typeable1 to just catch 'ArithException a' for any Typeable a? It seems like it should be, but I have not used Typeable1 much. John -- John Meacham - ⑆repetae.net⑆john⑈
participants (2)
-
John Meacham
-
Simon Marlow