Last Updated: February 25, 2016
·
1.212K
· bmjames

Scalaz 7 Applicative instance for Akka Future

implicit def FutureApplicative(implicit executor: ExecutionContext) = new Applicative[Future] {
  def point[A](a: => A) = Future(a)
  def ap[A,B](fa: => Future[A])(f: => Future[A => B]) =
    (f zip fa) map { case (f1, a1) => f1(a1) }
 }