protected def decodeMe24(input: ByteVector): Attempt[String] = HList.fill(24)(uint4).toCodec.decode(input.bits).map(_.value.mkString("", "", ""))
So, for example with a size-2 decoder, I have a Codec[Int] :: Codec[Int] :: HNil which with *toCodec* is supposed to transform into Codec[Int :: Int :: HNil] then I decode my payload and get a DecodeResult[HList] where I call mkString from HList...
final implicit class EnrichHList[L <: HList](val self: L) {
def toResult(input: ByteVector)(implicit to: codecs.ToHListCodec[L]): Attempt[String] = {
to(self)
.decode(input.bits)
.map(_.value.toList[Int].map(decodedIntDecimalToString).mkString)
}
}
But this does not compile because the toList[Int] call does not find its implicit :
could not find implicit value for parameter toTraversableAux: shapeless.ops.hlist.ToTraversable.Aux[to.L,List,Int]
[error] .map(_.value.toList[Int].map(decodedIntDecimalToString).mkString)
And I can't seem to find the proper definition...
Any help appreciated.
Regards,
Olivier.