-
-
Save guizmaii/6dc455daa87d999d1eb8b38cf68c2b77 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