You can make it pretty short too, if you allow yourself fix:

   rs=1:fix(\f p n->n++f(p++n)p)[1][0]

I came up with this on the train home, but then I realised it was the same as your solution :)

On 08/11/2007, at 12:57 PM, Alfonso Acosta wrote:

How about this,

infiniteRS :: [Int]
infiniteRS = let acum a1 a2 = a2 ++ acum (a1++a2) a1 in 1 : acum [1] [0]

it certainly fits in one line but it's not really elegant
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to