Understanding Haskell's fibonacci

Posted by AR on Stack Overflow See other posts from Stack Overflow or by AR
Published on 2010-03-08T19:37:55Z Indexed on 2010/03/09 1:21 UTC
Read the original article Hit count: 687

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

This generates the Fibonacci sequence.

I understand the behaviour of the guards, of :, zip and tail, but I don't understand <-. What is it doing here?

© Stack Overflow or respective owner

Related posts about haskell

Related posts about beginner