3

I'm learning Scala. While taking Martin Odersky's MOOC, I watched his talk at OSCON Java 2011 titled "Working Hard to Keep It Simple". In his presentation, he uses the .par method to make a collection parallel. But when I try to use .par in Scala, for example:

val numbers = List(1, 2, 3, 4, 5, 6)
val (evens, odds) = numbers.par partition(_ % 2 == 0)

I get this error:

Error:(6, 40) value par is not a member of List[Int]
did you mean map, max, or span?

What happened to the .par method in Scala 2.13?

Shant Dashjian
  • 888
  • 11
  • 20

0 Answers0