TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Understanding the Type of ‘call/cc’

38 点作者 leafac超过 6 年前

2 条评论

remcob超过 6 年前
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.<p>The return type of the continuation is better captured by something like the Bottom type from Haskell:<p><a href="https:&#x2F;&#x2F;wiki.haskell.org&#x2F;Bottom" rel="nofollow">https:&#x2F;&#x2F;wiki.haskell.org&#x2F;Bottom</a><p>In particular, &quot;Bottom is a member of any type&quot;, which is what solves my example above.
kazinator超过 6 年前
Ah, but a delimited continuation returns, so the analysis will be different. Basically, the continuation function&#x27;s return type is that of the prompt to which it is delimited. If that prompt isn&#x27;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.