Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akhilvijayan05/69923c8f6d1903df8e8c6c88367fa644 to your computer and use it in GitHub Desktop.
Save akhilvijayan05/69923c8f6d1903df8e8c6c88367fa644 to your computer and use it in GitHub Desktop.
import cats.instances.future._
import cats.syntax.cartesian._
val addFutureValue = Future(2 + 1)
val multiplyFutureValue = Future(2 * 1)
val substractFutureValue = Future(2 - 1)
val result: Future[Int] = (addFutureValue |@| multiplyFutureValue |@| substractFutureValue).map{ (addedValue, multipiedValue, substractedValue) =>
addedValue + multipiedValue + substractedValue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment