Skip to content

Instantly share code, notes, and snippets.

@longliveenduro
Created January 3, 2014 16:48
Show Gist options
  • Select an option

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

Select an option

Save longliveenduro/8241387 to your computer and use it in GitHub Desktop.
val success1 = 1.success[String]
val failure1 = "failure1".failure[Int]
val failure2 = "failure2".failure[Int]
for {
r1 <- success1
r2 <- failure1
r3 <- failure2
} yield r1 + r2 + r3
// will be a Failure(failure1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment