For example I want infer pbdirect instances for the following sealed trait:
import pbdirect._
sealed trait MyList
case class Cons(i: Int, l: MyList) extends MyList
case object Nil extends MyList
PBWriter[MyList] // error: could not find implicit value for evidence parameter of type pbdirect.PBWriter[MyList]
PBReader[MyList] // ok
PBReader is inferred just fine, but PBWriter is not.
My guess is that it should be tail: Lazy[PBWriter[T]] in implicit def cconsWriter instead of just tail: PBWriter[T]
implicit def cconsWriter[H, T <: Coproduct](
implicit head: PBWriter[H],
tail: PBWriter[T]): PBWriter[H :+: T] // it should be Lazy[PBWriter[T]]
just as it's implemented for PBReader
implicit def cconsParser[H, T <: Coproduct](
implicit
head: PBParser[H],
tail: Lazy[PBParser[T]]): PBParser[H :+: T]
For example I want infer
pbdirectinstances for the following sealed trait:PBReaderis inferred just fine, butPBWriteris not.My guess is that it should be
tail: Lazy[PBWriter[T]]inimplicit def cconsWriterinstead of justtail: PBWriter[T]just as it's implemented for
PBReader