Given the following list of tuples...
val list = List((1, 2), (1, 2), (1, 2))
... how do I sum all the values and obtain a single tuple lik
Scalaz solution (suggestied by Travis and for some reason a deleted answer):
import scalaz._ import Scalaz._ val list = List((1, 2), (1, 2), (1, 2)) list.suml
which outputs
res0: (Int, Int) = (3,6)