Skip to content

Instantly share code, notes, and snippets.

@dkomanov
Created May 22, 2020 22:17
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 dkomanov/cab022c99ec52ab71b82fa9e1f10c9f0 to your computer and use it in GitHub Desktop.
Save dkomanov/cab022c99ec52ab71b82fa9e1f10c9f0 to your computer and use it in GitHub Desktop.
[writing-async-app-in-scala-part-1] for-comprehensions 4
for {
_ <- hasPermissions orFail new PermissionDeniedException("...")
movie <- getMovie
if !movie.hidden
actors <- getActors(movie)
plot <- getPlot(movie)
} yield MovieDescription(movie, actors, plot)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment