3
$\begingroup$

Is there a standard name for the operator that takes a function $f:X\rightarrow(Y\rightarrow Z)$ and returns the function $f':Y\rightarrow(X\rightarrow Z)$ that satisfies, for every $y \in Y$ and $x \in X$, $f'(y)(x) = f(x)(y)$?

$\endgroup$

2 Answers 2

6
$\begingroup$

The function $$\lambda f.\lambda x.\lambda y.f\;y\;x$$ of type $$\forall X. \forall Y. \forall Z.(X \to Y \to Z) \to Y \to X \to Z$$ is often called flip. This is the case in Haskell (see here), and in some OCaml libraries as well (see here). According to wikipedia, people call this function (or combinator) $C$ in the context of combinatory logic (that name sounds pretty random though).

$\endgroup$
1
  • 2
    $\begingroup$ And the function $\forall X Y . X \times Y \to Y \times X$ is usually called the twist or swap map. $\endgroup$ Commented Jul 27, 2019 at 8:39
2
$\begingroup$

Given the tag , the answer in combinatory logic is C, i.e. "the C combinator". Obviously, this name is not self-documenting or going to be obvious in even a slightly more general context.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.