Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@amirkarimi
Created January 3, 2018 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amirkarimi/5e3cd74c9e5c7775d48446a25ef6fc5d to your computer and use it in GitHub Desktop.
Save amirkarimi/5e3cd74c9e5c7775d48446a25ef6fc5d to your computer and use it in GitHub Desktop.
def getCountryByUserId(id: Int): Future[Either[String, Country]] = {
val result = for {
user <- EitherT(getUser(id))
city <- EitherT(getCity(user))
country <- EitherT(getCountry(city))
} yield {
country
}
result.value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment