Scala Shapeless:对*arity进行抽象,并将返回类型作为内部抽象类型成员的元组

Scala Shapeless:对*arity进行抽象,并将返回类型作为内部抽象类型成员的元组,scala,shapeless,Scala,Shapeless,我想要的是对任意数量的var arg进行算术抽象,其中类型由抽象类型成员Value持有,如上所示。例如,从任意一个数到乘积,从乘积到一个HList或任何东西,然后从它到元组 abstract class Test[T] { type Value } // This is wrong with respect to Scala syntax. def fun(tests: Test[_]*): Tuple(tests(0)#Value, tests(1)#Value) = { } def测

我想要的是对任意数量的var arg进行算术抽象,其中类型由抽象类型成员
Value
持有,如上所示。例如,从任意一个数到乘积,从乘积到一个HList或任何东西,然后从它到元组

abstract class Test[T] {
  type Value
}

// This is wrong with respect to Scala syntax.
def fun(tests: Test[_]*): Tuple(tests(0)#Value, tests(1)#Value) = {
}
def测试[F、A、L、S、Rc S],
ev:S
def test[F, A, L, S, Rc <: Test[_]](f: F)(implicit ftp: FnToProduct.Aux[F, L => S],
  ev: S <:< Seq[Rc#Value]) {

  val sq = ev(ftp(f))

  // now I'd like to build a type to reference the return sequence in a tuple
  // What is the real way to do the below?
  type ReturnTpe = sq.foldLeft(HNil)((l, col) => col#Value :: l).tupled
}