Created
May 2, 2012 16:40
-
-
Save fdaoud/2578036 to your computer and use it in GitHub Desktop.
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
Something something = object.getSomething(); | |
if (something != null) { | |
SomeType[] someArray = something.getSomeArray(); | |
if (someArray != null) { | |
for (SomeType some : someArray) { | |
// call f(some) | |
} | |
} | |
} | |
/* | |
for { a <- aa; b <- bb; c <- cc } yield c is shorthand for this: | |
aa bind { a => bb bind { b => cc map { c => c } } } // still nested | |
and a => b is shorthand for new Function1[A,B] { public B apply(A a) { return b; } } | |
thank you to datura | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment