Consider the following code which uses ScalaZ's OptionT:
val answer = for {
customer <- optionT(function1(codeString))
customerId <- someOptionT(Future(Seq(function2(customer)))
alerts <- someOptionT(Future.sequence(function3(customerId))
} yield alerts
function1returnsFuture[Option[Customer]]function2returnsStringfunction3returnsSeq[Future[Option[String]]]
Meanwhile this is someOptionT
def someOptionT[T](t: Future[T]): OptionT[Future, T] = optionT[Future](t.map(Some.apply))
I get the following exception on the last line of the for comprehension (with alerts):
could not find implicit value for parameter F: scalaz.Functor[scala.concurrent.Future]
Any idea as to why?