I assume this is an easy one but I’m running into problem where the FlatMap or Functor of a Monix Task cannot be found. I use a "type alias" to simplify a long type signiture but then in the for-comprehession I receive a "could not find implicit value" error. If I remove the type alias then it works because Monix has cats support. Would anyone have a suggestion on how to tell the compiler that TaskEither is a Monix Task and can just use the cats instances provided by Monix Task. Type alias:
type TaskEither[A] = Task[Either[Erratum, A]]
Method where the error occurs: Note: getBotForUser and processBotDetails are both wrapped in a Kleisli similar to findCreateBot method
def findCreateBot(msg: Routing): Kleisli[TaskEither, DBRepo[MySQLProfile, ServiceConfig[Config]], ActorRef] ={
import Task._
for {
bot <- XmppRepository[MySQLProfile, ServiceConfig[Config]].getBotForUser(msg.routingHeader.to.userID)
botRef <- processBotDetails(bot)
} yield botRef
}
error message:
XMPPGateway.scala:61:14: could not find implicit value for parameter F: cats.Functor[MyTypes.TaskEither]
[error] botRef <- processBotDetails(bot)
[error]
^
error message:
XMPPGateway.scala:60:11: could not find implicit value for parameter F: cats.FlatMap[MyTypes.TaskEither]
[error] bot <- XmppRepository[MySQLProfile, ServiceConfig[Config]].getBotForUser(msg.routingHeader.to.userID)
[error]
^