
20 Jan
2011
20 Jan
'11
1:21 a.m.
On 1/17/11 11:10 PM, David Menendez wrote:
How are you defining CPS? In order to use id as a continuation in these circumstances, you pretty much need
newtype CPS a = CPS { unCPS :: forall w. (a -> w) -> w }
That tends to be my first thought when I think about CPS. In particular, the above gets at the fact that the CPS transform compilers do is just double negation.
But that's (mostly) isomorphic to the Identity monad
Indeed. But then, my first thoughts about CPS are more about the compiler transformation rather than about callCC. Cont is certainly valuable, but it's not the first thing that comes to mind for me. -- Live well, ~wren