Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created April 1, 2014 14:01
Show Gist options
  • Select an option

  • Save pedrofurla/9914570 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/9914570 to your computer and use it in GitHub Desktop.
import shapeless._
import shapeless.HList._
import Report._
import Chronograph._
val sample = ReportLine(1,1,Micros)
def toHList = Generic.product[ReportLine].to _
val sampleH = toHList(sample)
object stringfy extends Poly1 {
implicit def caseLong = at[Long](_.toString)
}
sampleH map stringfy
/*
[error] /Users/pedrofurla/dev/projects/slick/slick-perf/src/main/scala/exec/Chronograph.scala:103: could not find implicit value for parameter mapper: shapeless.ops.hlist.Mapper[exec.shapes.stringfy.type,shapeless.::[Int,shapeless.::[exec.Chronograph.Chronon,shapeless.::[exec.Chronograph.TimeUnit,shapeless.HNil]]]]
[error] sampleH map stringfy
[error] ^
[error] one error found
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment