arXiv · 2106.06278
Union and intersection contracts are hard, actually
Abstract
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.
Explore related subjects
Keep this discovery
Teodoro Freund, Yann Hamdaoui, Arnaud Spiwack. 2021-06-11. Union and intersection contracts are hard, actually. https://doi.org/10.1145/3486602.3486767
Cite the original work for its findings. Save a collection to share your selection of sources.