2

Say I have a function $g$ described by $$(x\stackrel f\mapsto y)\stackrel g\mapsto z$$ That is, $g$ takes a function, $f$, and maps it to another object, maybe just a real number or vector or whatever, $z$. How does this relate to the function $$(x,y)\stackrel h\mapsto z$$ Are they, in effect, the same?

P.S. I don't know what tags to choose for this, so feel free to edit.

2 Answers2

3

Your idea has a name: Currying.

There is an equivalence between functions $$f:X\times Y\longrightarrow Z$$ and $$\text{curry}(f):X\longrightarrow Z^Y$$ defined by $$(\text{curry}(f)(x))(y) = f(x,y).$$

3

No, they are not the same. You are confusing two related, but ultimately different function types.

One kind of function is

f : (a -> b) -> c

And the other kind is

g : a -> (b -> c)
g' : (a, b) -> c

One can construct an isomorphism between g and g' and it's easy to see how.

Given a g, I can construct a g' list so:

g'(a, b) = g(a)(b)

And to construct g from g', one can do this:

h_a(b) = g(a, b)
g(a) = h_a 

Where h_a is some function h indexed by a. You can think of h "having access" to a.

This isomorphism is called as currying / partial application and comes up often in functional programming languages.

These rules are often implicit in lambda calculus, a branch of mathematics created to study functions and their construction (and the relationship of these to Turing machines).