Last active
August 29, 2015 14:14
-
-
Save khalidr/38a2c2f18548afd8274f to your computer and use it in GitHub Desktop.
ApplicativeBuilder
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
case class Foo(f:String="",y:String,z:String) | |
object Foo{ | |
type Val = Validated[Foo] | |
implicit val x = new Validator[Foo]{ | |
def apply(v1: Foo): Validated[Foo] ={ | |
import v1._ | |
z.successNel[DomainValidationError] <*>(y.successNel[DomainValidationError] <*> (f.successNel[DomainValidationError] map (Foo.apply _).curried)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment