Extract FieldType key and value from HList
问题 I would like to extract the key and value of the head of an HList using these two methods: def getFieldName[K, V](value: FieldType[K, V])(implicit witness: Witness.Aux[K]): K = witness.value def getFieldValue[K, V](value: FieldType[K, V]): V = value I tried a few variations of this function, but I couldn't make it work, I think this might be the closest to the right solution: def getFieldNameValue[Key <: Symbol, Value <: AnyRef, Y <: HList, A <: Product](a : A) (implicit gen : LabelledGeneric