Skip to content

Instantly share code, notes, and snippets.

@windymelt
Created January 6, 2014 14:57
Show Gist options
  • Save windymelt/8283937 to your computer and use it in GitHub Desktop.
Save windymelt/8283937 to your computer and use it in GitHub Desktop.
cond
def check = {
val cond1 = (_: String) => if (1==2) Left("cond1") else Right("not matched")
val cond2 = (_: String) => if (2==2) Left("cond2") else Right("not matched")
val cond3 = (_: String) => if (3==2) Left("cond3") else Right("not matched")
val condList = List(cond1, cond2, cond3)
condList.reduce(_.flatMap)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment