MappingPackageInternalHacks1 AΒΆ

mappkg.spad line 1 [edit on github]

various Currying operations.

iter: (A -> A, NonNegativeInteger, A) -> A

iter(f, n, x) applies f n times to x.

recur: ((NonNegativeInteger, A) -> A, NonNegativeInteger, A) -> A

recur(g, n, x) is g(n, g(n-1, ..g(1, x)..)).