Open bayarmunkh opened 7 years ago
Example:
object TestService { sealed trait Account sealed trait RepoF[A] sealed trait Repo[A] case class Query(no: String) extends Repo[Either[String, Account]] case class Store(account: Account) extends Repo[Either[String, Account]] case class Delete(no: String) extends Repo[Either[String, Unit]] object Repo { type PRG = Repo :|: NilDSL val PRG = freek.DSL.Make[PRG] type O = Either[String, ?] :&: Bulb } def query(no: String) = Query(no) def store(account: Account) = Store(account) def delete(no: String) = Delete(no) // How do I write this function here ? def update(no: String): OnionT[Free, Repo.PRG.Cop, Repo.O, Int] = for { a <- Query(no).freeko[Repo.PRG, Repo.O] _ <- Store(a).freeko[Repo.PRG, Repo.O] } yield 1 }
when import cats.instances.either._ isn't imported, it gives a bit confusing compile error.
import cats.instances.either._
could not find implicit value for parameter lifter2: freek.Lifter2.Aux[Either[String,TestService.Account],TestService.Repo.O,TestService.Account]
basically it doesn't tell an implicit Application[G[_]] is missing in the scope. Any way to escalate implicitNotFound of Lifter2 into this scope?
Application[G[_]]
Could you try to add one to check what it does? I think we can improve the message but the precision of it will be relative naturally.
Example:
when
import cats.instances.either._
isn't imported, it gives a bit confusing compile error.basically it doesn't tell an implicit
Application[G[_]]
is missing in the scope. Any way to escalate implicitNotFound of Lifter2 into this scope?