I just ran across this post about using tuples in an anonymous function, and thought it was good enough to reproduce here, with only the solution part.
In essence, the question is, if I have a
Map like this, which is actually composed of tuples:
scala> val x = Map(1 -> "foo", 2 -> "bar")
x: scala.collection.immutable.Map[Int,String] = Map(1 -> foo, 2 -> bar)
how do I use each value in the tuples in an anonymous function?