Skip to content

Instantly share code, notes, and snippets.

@tksohishi
Last active December 24, 2015 08:39
Show Gist options
  • Select an option

  • Save tksohishi/6772195 to your computer and use it in GitHub Desktop.

Select an option

Save tksohishi/6772195 to your computer and use it in GitHub Desktop.
wtf scala ver.1
scala> val map = Map("One" -> "1", "Two" -> "2"); val v = for { one <- map("One"); two <- map("Two") } yield { one.toInt + two.toInt }
map: scala.collection.immutable.Map[String,String] = Map(One -> 1, Two -> 2)
v: scala.collection.immutable.IndexedSeq[Int] = Vector(99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment