title: Explanation of the aggregate scala function
body: <p>I do not get to understand yet the aggregate function:</p>
  
  <p>For example, having:</p>
  
  <pre><code>val x = List(1,2,3,4,5,6)
  val y = x.par.aggregate((0, 0))((x, y) =&gt; (x._1 + y, x._2 + 1), (x,y) =&gt; (x._1 + y._1, x._2 + y._2))
  </code></pre>
  
  <p>The result will be: <code>(21,6)</code></p>
  
  <p>Well, I think that <code>(x,y) =&gt; (x._1 + y._1, x._2 + y._2)</code> is to get the result in parallel, for example it will be (1 + 2, 1 + 1) and so on.</p>
  
  <p>But exactly this part that leaves me confused: </p>
  
  <pre><code>(x, y) =&gt; (x._1 + y, x._2 + 1)
  </code></pre>
  
  <p>why <code>x._1 + y</code>? and here <code>x._2</code> is <code>0</code>?</p>
  
  <p>Thanks in advance.</p>