I am a Scala noob, so please do not shoot me if this does not help.
Assuming this:
class MoreFilterOperations[Repr <% TraversableLike[T,Repr], T] (xs: Repr) {}
Something like this work?
// t2fo is short for traversableToFilterOps implicit def t2fo[Repr <% TraversableLike[T, Repr], T](xs: Repr) = new MoreFilterOperations[Repr, T](xs) // m2fo is short for mapToFilterOps implicit def m2fo[Repr <% Map[K, V] <% TraversableLike[(K,V), Repr], K, V] (xs: Repr) = new MoreFilterOperations[Repr, (K, V)](xs)
This should work because (according to the book I programmed by Scala, p264), the following method definition with an evaluation of the form:
def m [A <% B](arglist): R = ...
This is the same as the definition of this method:
def m [A](arglist)(implicit viewAB: A => B): R = ...
source share