On the Idempotence of the CPS Transformation - Danvy, Olivier; Malmkjær, Karoline (BRICS Report Series, 1996)
The CPS (continuation-passing style) transformation on typed lambda-terms has an interpretation in many areas of Computer Science, such as programming languages and type theory. Programming intuition suggests that in effect, it is idempotent, but this does not directly hold for all existing CPS transformations (Plotkin, Reynolds, Fischer, etc.). We rephrase the call-by-value CPS transformation to make it syntactically idempotent, modulo eta-reduction of the newly introduced continuation. Type-wise, iterating the transformation corresponds to refining the polymorphic domain of answers.