fold the elements of this list using the given monoid and initial valueUsed to fold a list tail-recursively