Last active
January 21, 2021 13:05
-
-
Save SebastianAas/cc809cbb9374ac86ef38bf844f7cecff to your computer and use it in GitHub Desktop.
Sum of collections
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
for { | |
a1 <- Future(Set(1, 2, 3)) | |
b1 <- Future(Set(1, 2, 3)) | |
} yield { | |
for { | |
x <- a1 | |
y <- b1 if y > 2 | |
} yield { | |
x + y | |
} | |
} | |
//Result: Future[Set(4,5,6)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment