sum: Use foldMap to avoid Functor constraint