Mixing in generic traits in parameterized classes without duplicating type parameters
问题 Let's assume I want to create a trait that I can mix in into any Traversable[T]. In the end, I want to be able to say things like: val m = Map("name" -> "foo") with MoreFilterOperations and have methods on MoreFilterOperations that are expressed in anything Traversable has to offer, such as: def filterFirstTwo(f: (T) => Boolean) = filter(f) take 2 However, the problem is clearly that T is not defined as a type parameter on MoreFilterOperations. Once I do that, it's doable of course, but then