给定 A :: B :: C 和 (A, B, C) => D,如何写 A :: B :: C => D?

How to write A :: B :: C => D given A :: B :: C and (A, B, C) => D?

假设我有一个类型为 A :: B :: CHList 和一个函数 (A, B, C) => D。如何用最简单最地道的方式写一个函数A :: B :: C => D

syntax.std.function中有方法toProduct:

import shapeless._
import syntax.std.function._
def testf(d: Double, l: Long, i: Int): String = s"$d, $l, $i"

(testf _).toProduct
// Double :: Long :: Int :: HNil => String = <function1>

参见Feature overview: shapeless 2.0.0/Facilities for abstracting over arity