Seeking Stability by being Lazy and Shallow
Gert-Jan Bottu, Richard A. Eisenberg

TL;DR
This paper introduces a stability-based criterion for designing language features, demonstrating that a lazy and shallow instantiation approach in GHC/Haskell yields the most stable polymorphic type handling.
Contribution
It proposes using stability as a decision criterion for language features and analyzes polymorphic type instantiation approaches, identifying lazy and shallow instantiation as optimal.
Findings
Lazy instantiation minimizes unintended meaning changes.
Shallow instantiation limits type variable instantiation to top-level variables.
The most stable approach combines laziness and shallow instantiation.
Abstract
Designing a language feature often requires a choice between several, similarly expressive possibilities. Given that user studies are generally impractical, we propose using stability as a way of making such decisions. Stability is a measure of whether the meaning of a program alters under small, seemingly innocuous changes in the code. Directly motivated by a need to pin down a feature in GHC/Haskell, we apply this notion of stability to analyse four approaches to the instantiation of polymorphic types, concluding that the most stable approach is lazy (instantiate a polytype only when absolutely necessary) and shallow (instantiate only top-level type variables, not variables that appear after explicit arguments).
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Engineering Research · Model-Driven Software Engineering Techniques
