Scala: how to merge a collection of Maps
Well, you could do: mapList reduce (_ ++ _) except for the special requirement for collision. Since you do have that special requirement, perhaps the best would be doing something like this (2.8): def combine(m1: Map, m2: Map): Map = { val k1 = Set(m1.keysIterator.toList: _*) val k2 = Set(m2.keysIterator.toList: _*) val intersection = k1 … Read more