Haskell infinite recursion
问题 The following function computes the Fibonacci sequence: fib = 0 : 1 : (zipWith (+) fib (tail fib)) If we run it, we will get an infinite list, but how does the recursion work? Why does it get to print numbers on the screen if it the function keeps calling itself? I would appreciate if you could explain how the compiler manages the calls. 回答1: I've drawn a picture, which you might find helpful. Note that zipWtih op (x:xs) (y:xs) = (op x y):zipWith xs ys , which is how zipWtih appears to "move"