Skip to content

Instantly share code, notes, and snippets.

@nitindhar7
Created June 29, 2016 16:25
Show Gist options
  • Save nitindhar7/f1e40986b2072987364a57273e888f76 to your computer and use it in GitHub Desktop.
Save nitindhar7/f1e40986b2072987364a57273e888f76 to your computer and use it in GitHub Desktop.
Test to see if for-comprehension yields result with a failing if guard
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
(for {
a <- Future.successful("a")
b <- Future.successful("b") if 1 > 0
c <- Future.successful("c") if 0 > 1
} yield (a, b, c)).foreach(println)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment