Created
January 21, 2021 10:21
-
-
Save SebastianAas/6c89d08d079067258bf3ff43b2a138e7 to your computer and use it in GitHub Desktop.
Example - For Comprehension
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 example() = { | |
val a1 = Set(1, 2, 3) | |
val b2 = Set(1, 2, 3) | |
for { | |
x <- a1 | |
y <- b2 if y > 2 | |
} yield { | |
x + y | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment