HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by moomin | Hacker News Reader
Parent
Full thread
moomin
·
The canonical zipWith solution is a thing of beauty.
View on HN
cgmg
·
I agree. The scanl version is even more elegant:
fibs = 0 : scanl (+) 1 fibs
Replacing 0 with 2 yields the Lucas numbers:
lucas = 2 : scanl (+) 1 lucas
Reply on news.ycombinator.com