Created
January 2, 2016 19:23
-
-
Save chrisphelps/98ecd5fe4fc6887d07e2 to your computer and use it in GitHub Desktop.
For-comprehension with map
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
for { | |
config <- configServiceResponse | |
user <- userServiceResponse | |
prefs <- getPreferencesForUser(user, config) | |
items <- getItemsForUser(user).map{ item => personalizeItem(item, prefs) } | |
} yield format(items) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment