No this is tail recursive and there is only one next thunk due to laziness.
zipWith :: (x -> y -> z) -> [x] -> [y] -> [z]
/-- this is the thunk
zipWith f (x:xs) (y:ys) = f x y : zipWith f xs ys
zipWith f _ _ = []
So if we have three terms, the computations is as follow (with thunks marked):
fibs = 1 : 1 : 2 : zipWith (+) (1 : 1 : 2 : thunk) (1 : 2 : thunk)
Because of laziness the thunks are only evaluated when needed.
Name:
Anonymous2013-08-01 18:35
>>7
I get that. But doesn't each unevaluated think get stored on the stack?
section '.shit2' import data readable writeable executable
library stdlib,'msvcrt.dll'
import stdlib, printf, "printf", scanf, "scanf"
fib db ' '
prompt db '%llu', 0
many dq 0
x dq 0,0,0
manyfibs db 'HOW MANY FIBS DO YOU WANT??? ',0
And they said FASM wasn't useful for anything.