Revisiting Occurrence Typing
Résumé
We revisit occurrence typing, a technique to re ne the type of variables occurring in type-cases and, thus, capture some programming patterns used in untyped languages. Although occurrence typing was tied from its inception to set-theoretic types-union types, in particular-it never fully exploited the capabilities of these types. Here we show how, by using set-theoretic types, it is possible to develop a general typing framemork that encompasses and generalizes several aspects of current occurrence typing proposals and that can be applied to tackle other problems such as the inference of intersection types for functions and the optimization of the compilation of gradually typed languages.
Mots clés
occurrence typing
type inference
union types
intersection types
TypeScript
Flow language
dynamic languages
type case
gradual typing
CCS Concepts: • Theory of computation → Type structures
• Software and its engi- neering → Functional languages
Functional languages
Type structures
Theory of computation
Program analysis
Domaines
Langage de programmation [cs.PL]Origine | Fichiers produits par l'(les) auteur(s) |
---|