[Haskell-cafe] About Fibonacci again...

ajb at spamcop.net ajb at spamcop.net
Thu Nov 8 00:42:20 EST 2007


G'day all.

Quoting ajb at spamcop.net:

> zipWith (!!) (fix (([1]:).map(>>= \x->if x==0 then [1] else [1,0]))) [0..]

This was the shortest variant I could manage in the time allotted:

     zipWith(!!)(fix(([1]:).map(>>= \x->1:[0|x==1])))[0..]

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list