Hacker News new | comments | show | ask | jobs | submit login
Understanding the Type of ‘call/cc’ (leafac.com)
38 points by leafac 8 days ago | hide | past | web | favorite | 2 comments





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

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


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.



Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: