Recursion & Polymorphismλ︎
Fixme work in progress
sum function will calculate the value of adding all the elements in a collection. You can alter the results by adding a starting value to the calculation as a second argument when calling
Rather than duplicate the calculation, the behaviour of calling
sum with just a collection simply calls
sum again, this time passing a starting value of zero.