示例#1
0
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
示例#2
0
 def curry(self, *args) -> "Program":
     cost, r = curry(self, list(args))
     return Program.to(r)