Skip to content

Instantly share code, notes, and snippets.

@SebastianAas
Last active January 21, 2021 13:30
Show Gist options
  • Save SebastianAas/1b1293638a2099bc9107545eca599bd3 to your computer and use it in GitHub Desktop.
Save SebastianAas/1b1293638a2099bc9107545eca599bd3 to your computer and use it in GitHub Desktop.
Example Improved
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