Created
March 19, 2018 15:33
-
-
Save jooohn/b4b9d28085de960efd35c45ad6fe6547 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
type ActionCont[T] = EitherT[Future, UseCaseResult, A] | |
final class FindWarriorImpl[Ctx <: IOContext]( | |
ctx: Ctx, | |
repository: WarriorRepository[Future] | |
) extends FindWarrior { | |
def apply(id: WarriorId): ActionCont[Warrior] = EitherT { | |
repository.resolveBy(id) map { | |
case Some(w) => Right(w) | |
case None => Left(WarriorNotFound) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment