Say we have the 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
}
Therefore, I can use this funcas
func(Set(1, 2) :: Set(3, 4) :: HNil, f)
In my code, I have a small number of policies and a large number of funcinvocations. To do this, I tried moving poly: Polyto implicit parameters and received the expected message
illegal dependent method type: parameter appears in the type of another parameter in the same section or an earlier one
How can I change or expand a parameter poly: Polyto avoid this error (I need to save the type signature func[T <: HList](...))?
source
share