Skip to content

Instantly share code, notes, and snippets.

@guizmaii
Forked from chwthewke/guizmaii.scala
Created February 23, 2017 15:18
Show Gist options
  • Save guizmaii/6dc455daa87d999d1eb8b38cf68c2b77 to your computer and use it in GitHub Desktop.
Save guizmaii/6dc455daa87d999d1eb8b38cf68c2b77 to your computer and use it in GitHub Desktop.
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