Last active
January 21, 2021 13:30
-
-
Save SebastianAas/1b1293638a2099bc9107545eca599bd3 to your computer and use it in GitHub Desktop.
Example Improved
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
def addAllCombinations() = { | |
val a = Future(Set(1, 2, 3)) | |
val b = Future(Set(1, 2, 3)) | |
for { | |
x <- SetF(a) | |
y <- SetF(b) if y > 2 | |
} yield { | |
x + y | |
} | |
} // Result: Future[Set(4,5,6)] | |
// PS. To get from SetF to Future[Set[Int]] use SetF.future |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment