Skip to content

Instantly share code, notes, and snippets.

@mchmielarz
Created March 14, 2019 22:35
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
for-comprehension: Building a car with Java's for-comprehension
final Option<Car> car = For(
 engine(),
 wheels(),
 body()
).yield(
 (engine, wheels, body) -> new Car(body, engine, wheels)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment