Say we have following method
def func[T <: HList](hlist: T, poly: Poly)
(implicit mapper : Mapper[poly.type, T]): Unit = {
hlist map poly
}
and custom Poly
object f extends (Set ~>> String) {
def apply[T](s : Set[T]) = s.head.toString
}
So I can use this func
like
func(Set(1, 2) :: Set(3, 4) :: HNil, f)
In my code I have small number of Polies and a big number of func
invocations. For this purpose I tried to move poly: Poly
to implicit parameters and got expected message
illegal dependent method type: parameter appears in the type of another parameter in the same section or an earlier one
How could I change or extend poly: Poly
parameter to avoid this error (I need to keep type signature func[T <: HList](...)
)?
Maybe you could use the "partially applied" trick using a class with an
apply
method :With your poly
f
: