News for hackers. Stuff that matters.
Re:Corecursion by gamegoblin on Thursday May 08, 2014 @06:31PM (#7718119)
Alternatively, making use of laziness and recursive definitions:

  fibonacci n = fibs !! n
  fibs = 1:1:zipWith (+) fibs (tail fibs)
Re:Corecursion by Pitarou on Thursday May 08, 2014 @07:41PM (#7718418)
Your version is certainly pretty, and it's based on an insight into the nature of the fibonacci series

But the value of co-recursion is that you don't need that insight. When you expand out the definitions of `tail`, `!!` and `zipWith`, your code turns out to be the same as mine[1], so I consider that a big win for co-recursion.

[1]: At least I think it does.