All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.specs2.control.FutureInstances.scala Maven / Gradle / Ivy

The newest version!
package org.specs2
package control

import scalaz._
import concurrent.Future

object FutureInstances {

  /** Applicative instance running futures in parallel for Scalaz */
  implicit val parallelApplicative = new Applicative[Future] {
    def point[A](a: => A): Future[A] = Future.futureInstance.point(a)
    def ap[A,B](fa: => Future[A])(f: => Future[A => B]): Future[B] =
      Future.futureInstance.mapBoth(fa, f)((a, function) => function(a))
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy