import java.lang.Integer; public class Y { y; public Y() { y = f -> t -> f.apply(y.apply(f)).apply(t); } } public class Fac1 { public factorial; public Fac1() { var y; var tmp = new Y<>(); // TODO Having new Y<>().y on one line doesn't work, see FIXME in StatementGenerator y = tmp.y; factorial = y.apply(f -> n -> { if (n == 0) return 1; else return n * f.apply(n - 1); }); } public fac(v) { return factorial.apply(v); } }