Created
March 14, 2019 22:33
-
-
Save mchmielarz/1851a4aa99599043f1f7c93d22e04907 to your computer and use it in GitHub Desktop.
for-comprehension: Building a car with Scala's for-comprehension
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
var car = for { | |
engine <- engine() | |
wheels <- wheels() | |
body <- body() | |
} yield Car(body, engine, wheels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment