
On 10 Mar 2008, at 12:37 AM, Donn Cave wrote:
On Mar 9, 2008, at 1:07 PM, Henning Thielemann wrote:
Errors are programming errors and must be fixed as Denis explained. Thus there is no need for a complex system of handling these situations at run-time. The program error might be unexpected but it isn't the fault of the user or of the context the program runs in but of the fault of the programmer. The program may report "bug detected, send an e-mail to the author" but eventually it should quit (at least the buggy thread) before worse things happen. This is possible in Haskell but should not be mixed up with handling of exceptions like "non-existing file".
I am not sure I see the difference in principle that you see.
An exception is, for me, any state that isn't properly accounted for in its immediate context. openFile could return 'Maybe Handle', but it doesn't, so the context demands a Handle or an exception.
In the context of this discussion, `Maybe Handle' /is/ an exception type, because Maybe is an exception monad. As is IO. This distinction is one between an unusual-but-anticipated code path, and a case the programmer simply didn't handle at all. The former is an exception; the latter is an error. jcc