Left fold java by public static A fold(F> f, A z, Iterable xs) { A p = z; for (B x : xs) { p = f.f(p).f(x); } return p; } Please follow and like us: