
Understanding the Type of ‘call/cc’ - leafac
https://www.leafac.com/prose/understanding-the-type-of-call-cc/
======
remcob
Look at the two examples where k is used with β being a String or a List. And
now combine the two examples, this would force β to be simultaneously String
and List -- impossible. A type parameter is not what we want here.

The return type of the continuation is better captured by something like the
Bottom type from Haskell:

[https://wiki.haskell.org/Bottom](https://wiki.haskell.org/Bottom)

In particular, "Bottom is a member of any type", which is what solves my
example above.

------
kazinator
Ah, but a delimited continuation returns, so the analysis will be different.
Basically, the continuation function's return type is that of the prompt to
which it is delimited. If that prompt isn't lexically determined, then oops;
we are back to a similar problem of not knowing what that is, with the
surcharge of having to know because it does return.

