Skip to content

Instantly share code, notes, and snippets.

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