If you add par
then you will get a parallel collection and operations on it will be processed in parallel. To convert back to a normal collection call a toList
.
So your code would look like:
a.par.map(tup => tup._1 + tup._2).toList
Or a .seq
to get a Sequential Collection (the opposite of a Parallel Collection).
a.par.map(tup => tup._1 + tup._2).seq