Skip to content

Instantly share code, notes, and snippets.

@chrisphelps
Created June 20, 2014 09:13
Show Gist options
  • Save chrisphelps/abd303948531b14f3ae4 to your computer and use it in GitHub Desktop.
Save chrisphelps/abd303948531b14f3ae4 to your computer and use it in GitHub Desktop.
Desugar the for-comprehension
f1 flatMap(a => for (b <- f2; c <- f3(b)) yield c * a)
f1 flatMap(a => f2 flatMap(b => for (c <- f3(b)) yield c * a))
f1 flatMap(a => f2 flatMap(b => f3(b) map(c => c * a)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment