Created
May 5, 2019 17:59
-
-
Save akhilvijayan05/69923c8f6d1903df8e8c6c88367fa644 to your computer and use it in GitHub Desktop.
This file contains 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.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