Continuation passing transform of binary functions Recall the continuation passing transform (CPS transform) which takes $A$ to $\beta A \mathrel{{:}{=}} R^{R^A}$ (where $R$ is fixed) and $f : A \to B$ to $\beta f : \beta A \to \beta B$ defined by
$$\beta \, f \, \kappa \, r \mathrel{{:}{=}} \kappa (r \circ f).$$
In fact we have the continuation monad with the unit $\eta_A : A \to \beta A$ defined by
$$\eta_A x \mathrel{{:}{=}} \lambda r . r \, x$$
and the multiplication $\mu_A : \beta (\beta A) \to \beta A$ defined by
$$\mu_A \, K \, r \mathrel{{:}{=}} K (\lambda f . f \, r).$$

Now let us think about how we can transform a binary map $f : A \to B \to C$, i.e, we want $\gamma f : \beta A \to \beta B \to \beta C$. One quickly comes up with
$$\gamma \, f \, \kappa \, \nu \, r \mathrel{{:}{=}}
   \kappa (\lambda x . \beta (f x) \nu r).$$
This makes sense from a programming point of view as well.

Here is my question: is there a deeper reason for $\gamma$, other than the fact that it looks right from a programming point of view? For instance, is there a category-theoretic or other "theoretical" reason for thinking that $\gamma$ makes sense? For instance, can we cook up $\gamma$ from the monad in a systematic way?

I am looking for an insight into CPS transforms of $n$-ary functions.
The closest I've seen to an answer to this question is the first picture in the Gallery of Doctor Melliès,

illustrating the map
$$\neg\neg A \otimes \neg\neg B \longrightarrow \neg\neg(A \otimes B)$$
which exists in any dialogue category (i.e., a monoidal category with closures into a fixed object).  Note that the left-to-right CPS transform of general binary functions reduces to applying this map and then composing with the functorial action of the double-negation monad.

The illustration basically follows the standard conventions of string diagrams (modulo the polarizations of the wires, which are meant to indicate the flow of control).  In particular, the map is constructed in three steps: twice applying the strength ($\kappa\wedge$) of the monad induced from the negation self-adjunction, and then applying the counit of the adjunction ($\epsilon$).  At this level of abstraction, the derivation is generic for any adjunction giving rise to a strong monad, and you could then ask for a more abstract characterization of such adjunctions, which Melliès has also written about.