Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The canonical zipWith solution is a thing of beauty.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: