Proposal: Extensible exceptions

Duncan Coutts duncan.coutts at
Fri Jul 18 12:04:14 EDT 2008

On Fri, 2008-07-18 at 11:19 -0400, Brandon S. Allbery KF8NH wrote:
> On 2008 Jul 18, at 11:05, Ian Lynagh wrote:
> > On Thu, Jul 17, 2008 at 09:16:36AM -0400, Isaac Dupree wrote:
> >>
> >> I'm not entirely happy with this particular sketch of a proposal,  
> >> but do
> >> people think that my initial issue is something to be concerned  
> >> about at
> >> all?  (I'd be glad to be disproved :-)
> >
> > It's hard to say if it'll be a problem in practice - we don't have any
> > experience with writing exception hierarchies.
> I'm going to ask a possibly silly question:  has anyone thought about  
> this vis-a-vis Simon's proposal of a new signals API?  It's not that  
> unusual for signals (usually SIGUSR1/SIGUSR2, often SIGINT, SIGHUP,  
> sometimes SIGABRT, SIGQUIT) to be used as asynchronous triggers ---  
> which might be best represented in the "Haskell world" as special  
> exceptions.  Likewise, it often makes sense to treat SIGPIPE, SIGHUP,  
> SIGINT as exceptions instead of signals.

SIGINT will be an exception in ghc-6.10. It will throw an async
exception to the main thread. We're just trying to think of the details
though, eg how to programs like ghci ignore ^C and can it be done in a
portable way.

SIGPIPE can be ignored because we get a sync exception when we write to
a pipe with no reader.


More information about the Libraries mailing list