Last active
January 1, 2016 05:39
-
-
Save longliveenduro/8099748 to your computer and use it in GitHub Desktop.
Validations: UserService with Either
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
| class UserId(id: Int) extends AnyVal | |
| trait UserRegistrationFailures | |
| case object NicknameAlreadyExists extends UserRegistrationFailures | |
| case object EmailAlreadyExists extends UserRegistrationFailures | |
| trait UserService { | |
| def registerUser(nickname: String, email: String, password: String): Future[\/[NonEmptyList[UserRegistrationFailures], UserId]] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment