Last active
May 2, 2018 20:28
-
-
Save dcampogiani/b1a3213da53deee236b7d058caae5235 to your computer and use it in GitHub Desktop.
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
fun validateData(mail: String, phoneNumber: String): Validated<Nel<String>, Data> { | |
return Validated.applicative<Nel<ValidationError>>(Nel.semigroup()).map(mail.validatedMail(), phoneNumber.validatedPhoneNumber()) { | |
Data(it.a, it.b) | |
}.fix() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment