(no subject)

Eileen Head head@cs.binghamton.edu
Sun, 13 Apr 2003 09:55:01 -0400 (EDT)


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