I was thinking about a nice way to convert a List of tuple with duplicate key [("a","b"),("c","d"),("a","f")] into map ("a" -> ["b", "f"], "c" -> ["d"]). Normally (in python), I'd create an empty map and for-loop over the list and check for duplicate key. But I am looking for something more scala-ish and clever solution here.
btw, actual type of key-value I use here is (Int, Node) and I want to turn into a map of (Int -> NodeSeq)
@LuigiPlinge A SeqView[String,Seq[_]] is also a Seq[String]. Still in hindsight I don't think that is worthwhile, so I removed the view. mapValues will do a view anyway on the values. – Daniel C. SobralNov 5 '11 at 2:59