Skip to content

Instantly share code, notes, and snippets.

@SebastianAas
Created January 21, 2021 10:21
Show Gist options
  • Save SebastianAas/6c89d08d079067258bf3ff43b2a138e7 to your computer and use it in GitHub Desktop.
Save SebastianAas/6c89d08d079067258bf3ff43b2a138e7 to your computer and use it in GitHub Desktop.
Example - For Comprehension
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