Guarded impredicative polymorphism

Publication date

2018-06-18

Authors

Serrano Mena, A.ISNI 0000000434518529
Hage, J.ISNI 0000000356203424
Vytiniotis, Dimitrios
Peyton Jones, Simon

Editors

Advisors

Supervisors

Document Type

Part of book
Open Access logo

License

taverne

Abstract

The design space for type systems that support impredicative instantiation is extremely complicated. One needs to strike a balance between expressiveness, simplicity for both the end programmer and the type system implementor, and how easily the system can be integrated with other advanced type system concepts. In this paper, we propose a new point in the design space, which we call guarded impredicativity. Its key idea is that impredicative instantiation in an application is allowed for type variables that occur under a type constructor. The resulting type system has a clean declarative specification — making it easy for programmers to predict what will type and what will not —, allows for a smooth integration with GHC’s OutsideIn(X) constraint solving framework, while giving up very little in terms of expressiveness compared to systems like HMF, HML, FPH and MLF. We give a sound and complete inference algorithm, and prove a principal type property for our system.

Keywords

Type systems, impredicative polymorphism, constraint-based inference, Taverne, General Computer Science

Citation

Serrano, A, Hage, J, Vytiniotis, D & Peyton Jones, S 2018, Guarded impredicative polymorphism. in Proceedings of the 39th ACM SIGPLAN Conference on Programming Language Design and Implementation. 4 edn, vol. 53, ACM SIGPLAN Notices, Association for Computing Machinery, pp. 783-796. https://doi.org/10.1145/3192366.3192389