
13 Apr
2003
13 Apr
'03
1:55 p.m.
I have two version of factorial as follows:
fac = 1.0: zipWith (*) [1.0 ..] fac
fact = 1.0: [ f | f <- zipWith (*) [1.. ] fact ]
Could some explain why does facBad run out of stack memory while fact work fine? i.e. ... > take 5 fact [1.0,1.0,2.0,6.0,24.0] ...> take 5 facBad [1.0 ERROR - Control stack overflow Thanks