This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.concurrent.duration.Duration | |
import scala.concurrent.{Await, ExecutionContext, Future} | |
object ParImpl { | |
sealed trait Par[A] { | |
def toFuture(implicit ec: ExecutionContext): Future[A] = { | |
this match { | |
case Par.Unit(f) => Future(f()) | |
case x:Par.Map2[A,_,_] => | |
for { |