scala - Mapping over HList raises AbstractMethodError -
i trying shapeless
example in repl , getting runtime error:
scala> import shapeless._ import shapeless._ scala> import shapeless.poly._ import shapeless.poly._ scala> object choose extends (set ~> option) { | def apply[t](set: set[t]) = set.headoption | } defined object choose scala> val sets = set(1) :: set(0) :: hnil sets: shapeless.::[scala.collection.immutable.set[int],shapeless.::[scala.collection.immutable.set[int],shapeless.hnil]] = set(1) :: set(0) :: hnil scala> sets map choose java.lang.abstractmethoderror: choose$.caseuniv()lshapeless/polydefns$case; ... 42 elided
do know why doesn't work , how fix ?
Comments
Post a Comment