static O mapLike curry(fO f, fO arg) { int n = numberOfFunctionArguments(f); if (n == 0) fail("function takes no arguments"); if (n == 1) ret new F0 { O get() { ret callF(f, arg); } toString { ret "curry(" + f + ", " + sfu(arg) + ")"; } }; if (n == 2) ret new F1 { O get(O a) { ret callF(f, arg, a); } toString { ret "curry(" + f + ", " + sfu(arg) + ")"; } }; throw todo("currying a function with " + n + "arguments"); }