Created
September 17, 2012 03:52
-
-
Save debasishg/3735459 to your computer and use it in GitHub Desktop.
trying to use Either in place of Validation
This file contains hidden or 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 validAge(age: Int): \/[String, Int] = //.. | |
def validName(name: String): \/[String, String] = //.. | |
(validAge(10).validation.toValidationNEL |@| validName("xxx").validation.toValidationNEL) { (a, n) => //.. } | |
/** | |
I am using the above snippet to accumulate errors using scalaz.Either and Validation. Is there any way to do the above without using Validation, just using Either. I don't like the conversion to Validation which I have to do just to lift the errors into a List for accumulation. | |
**/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment