Created
January 3, 2014 17:12
-
-
Save longliveenduro/8241939 to your computer and use it in GitHub Desktop.
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
| import scalaz._ | |
| import Scalaz._ | |
| object validationFailFast { | |
| case object ParseError | |
| case class Person(firstName: String, lastName: String) | |
| val success1 = "first".success[ParseError.type].toValidationNel | |
| val success2 = "last".success[ParseError.type].toValidationNel | |
| val result = (success1 |@| success2) { Person(_ , _) } | |
| println(result) | |
| // prints : Success(Person(first,last)) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment