The modified sum function will be written in such a way that it only takes a single parameter, a function f. As before, the function parameter f takes a parameter of type Int and returns a value of type Int. However, this time around, sum isn’t returning an Int type value, rather it is returning a complete function. Let’s look at the code below.