Abstract
Type inference for parametric polymorphism is wildly successful, but has always suffered from an embarrassing flaw: polymorphic types are themselves not first class. We present Quick Look, a practical, implemented, and deployable design for impredicative type inference. To demonstrate our claims, we have modified GHC, a production-quality Haskell compiler, to support impredicativity. The changes required are modest, localised, and are fully compatible with GHC's myriad other type system extensions.
Highlights
Parametric polymorphism backed by Damas-Milner type inference was first introduced in ML [Milner 1978], and has been enormously influential and widely used
It has always suffered from an embarrassing shortcoming: Damas-Milner type inference, and its many variants, cannot instantiate a type variable with a polymorphic type; in the jargon, the system is predicative
The lack of impredicativity means that polymorphism is fundamentally second class: we cannot abstract over polymorphic types
Summary
ALEJANDRO SERRANO, 47 Degrees, Spain and Utrecht University, The Netherlands JURRIAAN HAGE, Utrecht University, The Netherlands SIMON PEYTON JONES, Microsoft Research, United Kingdom DIMITRIOS VYTINIOTIS, DeepMind, United Kingdom. Type inference for parametric polymorphism is wildly successful, but has always suffered from an embarrassing flaw: polymorphic types are themselves not first class. We present Quick Look, a practical, implemented, and deployable design for impredicative type inference. We have modified GHC, a production-quality Haskell compiler, to support impredicativity. The changes required are modest, localised, and are fully compatible with GHC’s myriad other type system extensions. CCS Concepts: · Theory of computation → Type structures. Additional Key Words and Phrases: Type systems, impredicative polymorphism, constraint-based inference. ACM Reference Format: Alejandro Serrano, Jurriaan Hage, Simon Peyton Jones, and Dimitrios Vytiniotis. Lang. 4, ICFP, Article 89 (August 2020), 29 pages. https://doi.org/10.1145/ 3408971
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.