1# https://apocalisp.wordpress.com/2008/04/22/left-fold-in-java/
2# now that there is lambdas in Java it's certainly easier but
3# this one should stay with us for it is beautiful!
4
5 public static <A, B> A fold(F<A, F<B, A>> f, A z, Iterable<B> xs)
6 { A p = z;
7 for (B x : xs)
8 { p = f.f(p).f(x); }
9 return p; }