(1 to 3).par.scanLeft(10)(_-_) res: scala.collection.parallel.immutable.ParSeq[Int] = ParVector(10, 9, 7, 4) (1 to 3).par.scanRight(10)(_-_) res: scala.collection.parallel.immutable.ParSeq[Int] = ParVector(-8, 9, -7, 10) (1 to 3).par.scan(10)(_-_) res: scala.collection.parallel.immutable.ParSeq[Int] = ParVector(10, 9, -1, -4)
Basically, it depends on the implementation of the passing scan* (or fold* ) process.
source share