Trying to work out a better API for sum().