Skip to content

Instantly share code, notes, and snippets.

@tmyymmt
Created September 16, 2012 16:45
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 tmyymmt/3733157 to your computer and use it in GitHub Desktop.
Save tmyymmt/3733157 to your computer and use it in GitHub Desktop.
Monad 1
if (foo != null) {
Bar bar = foo.getBar();
if (bar != null) {
Baz baz = bar.getBaz();
if (baz != null)
return baz.compute();
else
return null;
}
else
return null;
}
else
return null;
@tmyymmt
Copy link
Author

tmyymmt commented Sep 16, 2012

Scala Monads: Declutter Your Code With Monadic Design - Marakana
http://marakana.com/s/scala_monads_declutter_your_code_with_monadic_design,1034/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment