Created
January 6, 2014 14:57
-
-
Save windymelt/8283937 to your computer and use it in GitHub Desktop.
cond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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