
On Monday 24 May 2010 15:48:14, Jonas Almström Duregård wrote:
Consider that calling
id undefined
requires evaluating undefined before you can call id. The program will "crash" before you ever call id. Of >course, the identity function "should" have produced a value that crashed in exactly the same way. But we >never got there.
In which sense does id need to evaluate its argument?
It doesn't need to, and it doesn't. It just returns its argument untouched.
If evaluating the statement "id undefined" in ghci, then the print function (and ultimately the show function) evaluates the undefined. I suppose that if the show function does not evaluate its argument then there will be no error, right?
Right: Prelude Text.Show.Functions> id undefined :: (Bool -> Bool) <function>
/Jonas