So the problem is in understandig HLists of shapeless library https://github.com/milessabin/shapeless ;
I'm using HLists
to store some functions i.e. :
val list = HList(
function1(_),
function2(_),
....
functionn(_)
);
And it works perfect: I can take any function from list and apply it:
list.head(object)
But, i have problem applying it with map
function (list map mapFunc
):
object mapFunc extends Poly1 {
implicit def default[T] =
at[T](t => {
t(obj)
})
}
It says Application doesnt take parameters
. So how can i deal with it? Mb I dont understand smth? I'm new to Scala.
p.s. there is an interesting effect with constructor this code is building lil bit incorrect:
function1(_) :: function2(_) :: HNil
it is recognized as function of some type, but HList(function1(_), function2(_))
has the right type.
EDIT
'p.s.' was decided - function1(_) :: function2(_) :: HNil
really has type mismatch; but function1 _ :: function2 _ :: HNil
is ok!