Manual type deduction for sum