We revisit occurrence typing, a technique to refine the type of variables occurring in type-cases and, thus, capturesome programming patterns used in untyped languages. Although occurrence typing was tied from its inceptionto set-theoretic types-union types, in particular-it never fully exploited the capabilities of these types. Here weshow how, by using set-theoretic types, it is possible to develop a general typing framework that encompasses andgeneralizes several aspects of current occurrence typing proposals and that can be applied to tackle other problemssuch as the reconstruction of intersection types for unannotated or partially annotated functions and the optimizationof the compilation of gradually typed languages.
翻译:我们重新研究发生打字,这是一种改进类型中出现的变数类型的技术,因此,是一种改进非类型语言中使用的捕捉式编程模式的技术。虽然发生打字从一开始就与设置理论型式工会类型挂钩,特别是从未充分利用过这些类型的能力。这里我们想看看如何通过使用设定理论型号,开发一个通用打字框架,它包含并概括了当前打字建议的若干方面,并可用于解决其他问题,例如重建未加说明或部分附加说明功能的交叉类型,以及优化逐步打字语言的汇编。