How to transform:
(Map(UserLang -> en, UserName -> a),1)
(Map(UserLang -> jp, UserName -> b),1)
to
(UserLang -> en, UserName -> a)
(UserLang -> jp, UserName -> b)
How to do this via functional programming
Try something like this:
val map1: Map[(String, String),Int]
val map2: Map[String, String] = map1.keySet.toMap
.keySet discards the Int and turns your Map[(String, String),Int] into a Set[(String,String)] which you can then easily convert to a Mapby calling toMap.