given:
val m = Map[String, Int](\"a\" -> 1, \"b\" -> 2, \"c\" -> 3) m.foreach((key: String, value: Int) => println(\">>> key=\" + key + \",
Yet another way:
Map(1 -> 1, 2 -> 2).foreach(((x: Int, y: Int) => ???).tupled)
However it requires explicit type annotations, so I prefer partial functions.