I have the following method in Scala which uses recursion:
def foldLeft[Result](initial:Result, op:(Result, Elem) => Result) : Result = { if (isEmpty)