Continuations in mathematics: nice examples?

Solution 1:

I think I've found an example. The double negation translation from the implicational fragment of Intuitionistic logic (with $\{\neg, \rightarrow\}$ as connectives) to classical logic seems to satisfy the axioms for a continuation monad.

We have

$\mathbb{M}\alpha = (a \rightarrow \bot) \rightarrow \bot$

$ \eta(a) = \lambda c_{(\alpha \rightarrow \bot) \rightarrow \bot}. c(a)$

$m * k = \lambda c. m (\lambda a. k(a)(c))$

$\eta$ maps formulas to their double negations. '*' Maps $\neg \neg A$ and $\neg \neg A \rightarrow \neg \neg B)$ to $\neg \neg B$

Still, I would prefer to have some examples outside of logic and from other parts of mathematics