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) }
}
Written by Ben James
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Scala
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#