def check_idempotency(f, args): cost, curried = curry(f, args) r = disassemble(curried) f_0, args_0 = uncurry(curried) assert disassemble(f_0) == disassemble(f) assert disassemble(args_0) == disassemble(args) return r
def curry(self, *args) -> "Program": cost, r = curry(self, list(args)) return Program.to(r)