According to the paper on parallel collections and searching on the internet, parallel collections are supposed to work with views, but I am not clear on the difference between
coll.par.view.someChainedIterations
and
coll.view.par.someChainedIterations
It seems like coll.view.par
looses the viewness of the collection:
scala> val coll = 1 to 3
coll: scala.collection.immutable.Range.Inclusive = Range(1, 2, 3)
scala> coll.view.par
res2: scala.collection.parallel.ParSeq[Int] = ParArray(1, 2, 3)
scala> coll.par.view
res3: java.lang.Object with scala.collection.parallel.ParSeqView[Int,scala.collection.parallel.immutable.ParSeq[Int],scala.collection.immutable.Seq[Int]] = $anon$1(1, 2, 3)
but I do not know why. Is it a feature or a bug?