[Haskell-cafe] About Fibonacci again...

Bernie Pope bjpop at csse.unimelb.edu.au
Thu Nov 8 01:08:56 EST 2007


>
> Is this what you are looking for:
>
>    mrs = [0] : [1] : zipWith (++) (tail mrs) mrs
>
> then you can get the one you want with:
>
>    mrs !! index
>
> given a suitable value for index

It seems I didn't read the question carefully - you want the infinite  
list.

You can recover the solution from mrs if you want, but its not very  
pretty:

infrs = [(mrs !! n) !! (n-1) | n <- [1..]]


More information about the Haskell-Cafe mailing list