Haskell for Perl ProgrammersInfinite ListsFibonacci with Lists

3.1. Fibonacci with Lists

fibs
= [
0,
1]
++ [a
+b
| (a,b)
<- zip fibs (tail fibs) ]

-- zip is defined as:
-- zip (x:xs) (y:xs) = (x,y) : zip xs ys
-- zip xs ys = []

Written by Shlomi Fish