Hi
I have been looking at this fibonacci implementation:
f = 0:1:(zipWith (+) f (tail f))
and I have been trying to fit it inside my head. I am not quite there yet, though.
I have been tracing the steps manually like this
0:1
[0,1]
[1]
0:1:1
[0,1,1]
[1,1]
0:1:1:2
[0,1,1,2]
[1,1,2]
0:1:1:2:3
[0,1,1,2,3]
[1,1,2,3]
0:1:1:2:3:5
And it is easy to see that it works, but what I do not understand is how the two recursive applications progress. How do they evolve concurrently? For each execution of `f`, `f` will be executed twice. So how does all these results end up in the same list?
I guess a more general way of asking my question is how does concurrent recursion on the same result-set work?