Created
February 23, 2017 15:15
-
-
Save chwthewke/c77dfe8ea7f8702eca9f12acb38270f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 cats.instances.future._ | |
import cats.instances.option._ | |
import cats.syntax.traverse._ | |
import cats.syntax.cartesian._ | |
import scala.concurrent.Future | |
trait Guizmaii { | |
import scala.concurrent.ExecutionContext.Implicits.global | |
type A | |
type B | |
def f(x: A, y: A): Future[Option[B]] | |
def solution(x: Option[A], y: Option[A]) : Future[Option[B]] = | |
(x |@| y).map(f).flatSequence | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment