[Haskell-cafe] About Fibonacci again...

Ross Paterson ross at soi.city.ac.uk
Thu Nov 8 02:40:03 EST 2007


On Thu, Nov 08, 2007 at 12:56:46AM +0100, jerzy.karczmarczuk at info.unicaen.fr wrote:
> This nasty acquaintance of mine asked the students to write down a simple
> procedure which generates the sequence after the infinite number of units
> of time. Of course, any finite prefix of it.

rabbit = let rs = 0 : [x | r <- rs, x <- if r==0 then [1] else [1,0]] in 1 : rs


More information about the Haskell-Cafe mailing list