Skip to content

Instantly share code, notes, and snippets.

@kevinmeredith
Created January 18, 2017 15:41
Show Gist options
  • Select an option

  • Save kevinmeredith/b4b3e35bf7bfadce253a8d74aef1c7ef to your computer and use it in GitHub Desktop.

Select an option

Save kevinmeredith/b4b3e35bf7bfadce253a8d74aef1c7ef to your computer and use it in GitHub Desktop.
var args
scala> import scala.collection.immutable.ListMap
import scala.collection.immutable.ListMap
scala> ListMap[Int, String]( (42, "hi"), (66, "world") )
res1: scala.collection.immutable.ListMap[Int,String] = Map(42 -> hi, 66 -> world)
scala> val list: List[(Int, String)] = List( (42, "hi"), (66, "world") )
list: List[(Int, String)] = List((42,hi), (66,world))
scala> ListMap[Int, String]( list: _* )
res2: scala.collection.immutable.ListMap[Int,String] = Map(42 -> hi, 66 -> world)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment