Poll: System.exitWith behaviour

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
22 May 2001 17:06:02 GMT

Tue, 22 May 2001 15:43:45 +0100, Simon Marlow <simonmar@microsoft.com> pisze:

>    - If this exception propogates to the top of the thread, then
>      the main thread is also sent (ExitException code).  This
>      only happens for a standalone executable (ie. one which was
>      started by PrelMain.mainIO).

This looks like a strange exception for me (i.e. the fact that it
propagates to the main thread). And it's weird to have it as an
asynchronous exception in the main thread.

I would drop this rule and let 'exitWith ExitSuccess' be the way to
commit suicide by a thread, as if it completed, which degenerates to
the Haskell 98 interpretation in a single-threaded program.

BTW, I don't quite like the fact that 'exitFailure' looks simpler than
'exitWith ExitSuccess'.

 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
  ^^                      SYGNATURA ZASTĘPCZA