Created
December 17, 2015 16:38
-
-
Save joescii/c7c216e77a75ab2e3c05 to your computer and use it in GitHub Desktop.
ListMap.keys should be a List
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> import scala.collection.immutable.ListMap | |
import scala.collection.immutable.ListMap | |
scala> val m = ListMap("a" -> "1", "b" -> "2", "c" -> "3", "d" -> "4", "e" -> "5") | |
m: scala.collection.immutable.ListMap[String,String] = Map(a -> 1, b -> 2, c -> 3, d -> 4, e -> 5) | |
scala> val ks = m.keys.toList | |
ks: List[String] = List(a, b, c, d, e) | |
scala> val upper = m.keys.map(_.toUpperCase).toList | |
upper: List[String] = List(E, A, B, C, D) // WTF??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment