
12 Mar
2007
12 Mar
'07
5:53 p.m.
On 3/12/07, Kirsten Chevalier
On 3/12/07, Albert Y. C. Lai
wrote: main = print (map (const 'x') (take 1 (undefined:undefined)))
In ghci, or with ghc -O0, this produces "x". With ghc -O, this produces Prelude.undefined.
What version of ghc?
I was curious, so I checked this against ghc 6.6. Indeed, it exhibits the behavior Albert describes above. Same goes for the HEAD. In ghc 6.4.2, however, the program prints "x" whether compiled with -O or -O0. This does seem like a bug to me. Cheers, Kirsten -- Kirsten Chevalier* chevalier@alum.wellesley.edu *Often in error, never in doubt "Live fast, love hard, and wear corrective lenses if you need them." --Webb Wilder