[Haskell-cafe] Re: [Haskell] ANNOUNCE: control-monad-exception 0.5 with monadic call traces

Gregory Crosswhite gcross at phys.washington.edu
Mon Dec 7 05:42:25 EST 2009


Ah, I had been meaning to read your article, so I appreciate you posting the link to it a second time.  :-)

Out of curiosity, how would you classify an "error" that results from a perfectly fine program, but ill-formed user input, such as when compiling a source file?

Cheers,
Greg


On Dec 7, 2009, at 2:23 AM, Henning Thielemann wrote:

> klondike schrieb:
>> Henning Thielemann escribió:
>> 
>>> It seems again to me, that mixing of (programming) errors and
>>> exceptions is going on, and I assumed that the purpose of
>>> control-monad-exception is to separate them in a better way.
>> You know, could you tell me when using head on an empty list is a
>> programming error and when it is a exception, I have seen both cases...
> 
> The case of (head []) is simple: It is a programming error, since the
> precondition for calling 'head' is that the argument list is non-empty.
> The caller of 'head' is responsible to check this. If the list comes
> from user input, then the program part that receives this list from the
> user is responsible to check for the empty list before calling 'head'.
> If there is no such check, this is a programming error, and it will not
> be possible to handle this (like an exception). Before you answer: "What
> about web servers?", please read on the article I have written recently
> to sum up the confusion about errors and exceptions:
> 
> http://www.haskell.org/haskellwiki/Error_vs._Exception
> 
> 
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list