4 ms·
Presumably tail-recursion is the natural expression of your algorithm. (I will admit that I wish the compiler could optimize something of the form "sum (x:xs)
by jrockway 17y ago
Presumably tail-recursion is the natural expression of your algorithm.
(I will admit that I wish the compiler could optimize something of the form "sum (x:xs) = x + sum xs"; instead you have to write "sum k (x:xs) = sum (k + x) xs".)