According to the scaladoc for the map method on a Map object, it should return a new Map:
def map [B] (f: ((A, B)) ⇒ B) : Map[B]
"returns a new map resulting from applying the given function f to each element of this map and collecting the results. "
But it doesn't:
scala> val countries = Map("NO" -> "Norway", "US" -> "United States", "DE" -> "Germany")
countries: scala.collection.immutable.Map[java.lang.String,java.lang.String] = Map((NO,Norway), (US,United States), (DE,Germany))
countries map { _._1 }
res4: scala.collection.immutable.Iterable[java.lang.String] = List(NO, US, DE)
This behaviour is what I would expect, though. So is the documentation wrong, or am I missing something?