3 ms·
https://wiki.haskell.org/The_Fibonacci_sequence https://wiki.haskell.org/The_Fibonacci_sequence
by dustingetz 9y ago
https://wiki.haskell.org/The_Fibonacci_sequence https://wiki.haskell.org/The_Fibonacci_sequence
- moomin 9y agoThe canonical zipWith solution is a thing of beauty.
- cgmg 9y agoI 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
- e12e 9y agoSeems to be a case of reality imitating satire: https://www.willamette.edu/~fruehr/haskell/evolution.html https://www.willamette.edu/~fruehr/haskell/evolution.html ;-) But, thanks for the pointer - from a glance it looks like a fine way to compare and contrast approaches/flavours of haskell programming.