In Scala I want to create a generic new Map class called MyClass. In this class i want to maintain the generality of types and modify only method ++ for Sequence type.
The ++ method must merge the equal object for the same key in this map.
val map1 = ("a"->Seq(1,2))
val map2 = ("a"->Seq(2,3))
the result must be
map1++map2 = ("a"->Seq(1,2,3))
map1++map2 = ("a"->Seq(2,3))
For all other type MyMap must be the same of "classic" Map class.
As others have pointed out in the comments, you should try something first and then come back if you encounter some specific problem. Here's how you can start, given that you want to implement the Map trait: