[Haskell-cafe] Re: Type question in instance of a class

Henning Thielemann lemming at henning-thielemann.de
Sat Nov 22 16:36:28 EST 2008

On Sat, 22 Nov 2008, Janis Voigtlaender wrote:

> Definitely. And that surfaces even in quite innocently looking programs
> and statements about them. The introductory example of the following
> technical report may be amusing in that respect:
> http://wwwtcs.inf.tu-dresden.de/~voigt/TUD-FI08-08.pdf

In example 1, I don't see on the one hand, why 'takeWhile (null.tail)' 
could fail with "tail: empty list", since all lists in '[[i] | i <- 
[1..(div 1 0)]]' are non-empty (namely singletons). On the other hand, 
aren't those imprecise error problems not just proofs that mixing up 
errors and exceptions (here treating errors as exceptions) is a bad thing? 
'error' is only a candy version of 'undefined' for simplifying debugging. 
If all 'error's are replaced by 'undefined' (plain bottom) then 'takeWhile 
p (map h l)' and 'map h (takeWhile (p.h) l)' behave also visually 
identical, don't they?

More information about the Haskell-Cafe mailing list