"TAPL") :: ("id" ->> 262162091) :: ("price" ->> 44.11) :: HNil ! scala> book("author") // Note the result type res0: String = Benjamin Pierce ! scala> book("id") // Note the result type res1: Int = 262162091
SingleInhabitant] { def sample = { val rnd = new scala.util.Random val from = inhabitant[From] val to = inhabitant[To] (from + rnd.nextInt(to - from + 1)) } }
scala> val t: x.type = 42 <console>:8: error: type mismatch; found : x.type (with underlying type Int) required: AnyRef val t: x.type = 42 ^ scala> val workaround = Witness(42) workaround: shapeless.Witness{type T = Int(42)} = fresh$macro$3$1@35b45d3f ! scala> val t: workaround.T = 42 t: workaround.T = 42 Even more