Skip to content

Instantly share code, notes, and snippets.

@debasishg
Created September 17, 2012 03:52
Show Gist options
  • Save debasishg/3735459 to your computer and use it in GitHub Desktop.
Save debasishg/3735459 to your computer and use it in GitHub Desktop.
trying to use Either in place of Validation
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