工会和交叉合同实际上很难
Union and intersection contracts are hard, actually
摘要:
联合和交集类型是逐渐类型化语言(如TypeScript)的主要类型。虽然人们早就认识到联合和交集类型很难静态验证,但初看起来渐进类型的动态部分实际上非常简单。然而,事实证明,在高阶契约的存在下,联合和交集是看似困难的。关于并和交的高阶契约的文献,虽然敏锐地意识到了这一事实,但并没有真正解释为什么。我们指出并说明了工会和交叉合同固有的问题和权衡,通过例子和文献调查。
英文摘要:
Union and intersection types are a staple of gradually typed language such as TypeScript. While it's long been recognized that union and intersection types are difficult to verify statically, it may appear at first that the dynamic part of gradual typing is actually pretty simple. It turns out however, that in presence of higher-order contracts union and intersection are deceptively difficult. The literature on higher-order contracts with union and intersection, while keenly aware of the fact, doesn't really explain why. We point and illustrate the problems and trade-offs inherent to union and intersection contracts, via example and a survey of the literature.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。