Created
February 10, 2016 23:39
-
-
Save lomholdt/6e4e614c4023d8f62d0c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public <A, B> B foldLeft(List<A> l, B z, Function2<B, A, B> f) { | |
List list; | |
do { | |
if (Nil..MODULE$.equals((Object)(list = l))) { | |
B b = z; | |
return b; | |
} | |
if (!(list instanceof .colon.colon)) break; | |
.colon.colon colon2 = (.colon.colon)list; | |
Object h = colon2.head(); | |
List t = colon2.tl$1(); | |
Object object = f.apply(z, h); | |
z = object; | |
l = t; | |
} while (true); | |
throw new MatchError(list); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment