I wondered whether continuations, used in computer science, occur as natural and interesting mathematical structures, perhaps as algebraic (in the theory of monoids?), model-theoretic or type theoretic structures, of some kind.
Continuations as I understand them are monads (which in turn are monoids). More precisely, suppose that our monad maps types of some kind to other types. Let $\alpha, \beta$ be types and $\rightarrow$ be a mapping between types, and let $a : \alpha \hspace{0.2cm}$ (or $b: \beta)$ indicate that $a\hspace{0.2cm}$ (or $b$) is an expression of type $\alpha \hspace{0.2cm}$ (or $\beta)$. Then a continuation monad is a structure $\thinspace(\mathbb{M}, \eta, ⋆)\thinspace$, with $\eta$ the unit and ⋆ the binary operation of the monoid) such that:
$$\mathbb{M} \thinspace α = (α → ω) → ω, \hspace{1cm} ∀α$$ $$η(a) = λc. c(a) : \mathbb{M} \thinspace α \hspace{1cm} ∀a : α $$ $$m ⋆ k = λc. m (λa. k(a)(c)): \mathbb{M}\thinspace β \hspace{1cm} ∀m : \mathbb{M}\thinspace α, k : α → \mathbb{M}\thinspace β . $$
Continuation monads have been used to effect a mapping that is available in full second order logic (discussed in two previous questions on this site: Principal ultrafilters and The existence of a function between the individuals of the domain and the set of all subsets of the domain in SOL) from an individual in a domain to the principle ultrafilter containing that individual (see for example https://arxiv.org/abs/cs/0205026). In type theoretic terms we thus map an individual of type $e$ (the type of individuals) to something of type $(e → t) → t$ (the type of sets of sets), matching the original treatment of English quantification by Montague (1974).
However, I wondered whether the particular type of monad that continuations exemplify occurs in mathematical structures that mathematicians study. Perhaps there are interesting structures, for example involving ultrafilters that are examples of continuations.
The following link discusses the relation between continuations and the Yoneda embedding:
However, I would be particularly interested in examples of mathematical structures that act like continuations in fields such as algebra (perhaps in the theory of monoids?), set theory or model theory (and outside of category theory).