4 ms·
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
by cgmg 9y ago
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