difference between foldLeft and reduceLeft in Scala

I have learned the basic difference between foldLeft and reduceLeft foldLeft: initial value has to be passed reduceLeft: takes first element of the collection as initial value throws exception if collection is empty Is there any other difference ? Any specific reason to have two methods with similar functionality? 8 Answers 8

Akka Kill vs. Stop vs. Poison Pill?

Newbie question of Akka – I’m reading over Akka Essentials, could someone please explain the difference between Akka Stop/Poison Pill vs. Kill ? The book offers just a small explaination “Kill is synchronous vs. Poison pill is asynchronous.” But in what way? Does the calling actor thread lock during this time? Are the children actors … Read more

Scala 2.8 breakOut

In Scala 2.8, there is an object in scala.collection.package.scala: def breakOut[From, T, To](implicit b : CanBuildFrom[Nothing, T, To]) = new CanBuildFrom[From, T, To] { def apply(from: From) = b.apply() ; def apply() = b.apply() } I have been told that this results in: > import scala.collection.breakOut > val map : Map[Int,String] = List(“London”, “Paris”).map(x => … Read more