Parallel collections in Scala 2.12 were importable out-of-the-box like so
import scala.collection.parallel.immutable.ParVector
val pv = new ParVector[Int]
however why in Scala 2.13 package scala.collection.parallel
seems to be missing?
Parallel collections have been moved in Scala 2.13 to separate module scala/scala-parallel-collection
This Scala standard module contains the package scala.collection.parallel, with all of the parallel collections that used to be part of the Scala standard library.
For Scala 2.13, this module is a separate JAR that can be omitted from projects that do not use parallel collections.
thus from 2.13 onwards we need the following dependency
libraryDependencies += "org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.0"
and to enable .par
extension method import
import scala.collection.parallel.CollectionConverters._
Corresponding scaladoc is also no longer available from 2.13 API docs but instead is published at javadoc.io/doc/org.scala-lang.modules/scala-parallel-collections_2.13.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With