Skip to content

Instantly share code, notes, and snippets.

@longliveenduro
Created January 3, 2014 15:20
Show Gist options
  • Select an option

  • Save longliveenduro/8239567 to your computer and use it in GitHub Desktop.

Select an option

Save longliveenduro/8239567 to your computer and use it in GitHub Desktop.
object optionForCompr {
val opt1 = Some(1)
val opt2 = Some(2)
val opt3 = Some(3)
for {
r1 <-opt1
r2 <-opt2
r3 <-opt3
} yield r1 + r2 + r3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment