4 ms·
The canonical zipWith solution is a thing of beauty.
by moomin 9y ago
The 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