title: How can I get a sum of arrays of tuples in scala
body: <p>I have a simple array of tuples</p>
  
  <pre><code>val arr = Array((1,2), (3,4),(5,6),(7,8),(9,10))
  </code></pre>
  
  <p>I wish to get <code>(1+3+5+7+9, 2+4+6+8+10)</code> tuple as the answer</p>
  
  <p>What is the best way to get the sum as tuples, similar to regular arrays. I tried</p>
  
  <pre><code>val res = arr.foldLeft(0,0)(_ + _)
  </code></pre>
  
  <p>This does not work.</p>
  
  <p>Sorry about not writing the context. I was using it in scalding with algebird. Algebird allows sums of tuples and I assumed this would work. That was my mistake.</p>