Skip to content

Instantly share code, notes, and snippets.

@jonifreeman
jonifreeman / gist:6533463
Created September 12, 2013 05:54
Explicit type for a Shapeless record.
object TestExplicitRecordType {
import shapeless._, record._, syntax.singleton._
object testF extends Poly1 {
implicit def atFieldType[F, V](implicit wk: shapeless.Witness.Aux[F]) = at[FieldType[F, V]] {
f => wk.value.toString
}
}
// Is there more straighforward way to give an explicit type for a record?