Syntactic Implicit Parameters with Static Overloading
Daan Leijen, Tim Whiting
Abstract
Implicits provide a powerful mechanism for term-based inference, where "obvious" arguments can be omitted and inferred by the type checker. This can greatly reduce the programmer's burden and improve the clarity of expression. As such, many languages support a form of implicits in practice, such as type classes in Haskell or Lean, or implicits in Scala. Unfortunately, many of these systems have become increasingly complex and often require significant implementation effort.
In this paper we take a fresh look at the design space with an arguably simpler approach based on two orthogonal features: syntactic implicit parameters and static overloading. Each of these features is limited in scope and has a straightforward implementation. Taken together though, they are surprisingly expressive and we believe they can cover many of the common usage scenarios of implicits in practice.
We formalize our system and provide various examples, and prove our elaboration is coherent. We also give an inference algorithm and show it is sound and complete. Our system is fully implemented in the Koka language, and we describe our experience with these features at scale, and discuss further extensions.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
Builds on1
Related papers
- Type Inference LogicsDenis Carnier, François Pottier, Steven KeuchelOOPSLA 2024 · 3 citations
- Greedy Implicit Bounded QuantificationChen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraOOPSLA 2023 · 9 citations
- Partial type constructors: or, making ad hoc datatypes less ad hocMark P. Jones, J. Garrett Morris, Richard A. EisenbergPOPL 2020 · 1 citation
- Fluent APIs in Functional LanguagesOri Roth, Yossi GilOOPSLA 2023 · 3 citations
- Bidirectional Higher-Rank Polymorphism with Intersection and Union TypesShengyi Jiang, Chen Cui, Bruno C. d. S. OliveiraPOPL 2025 · 2 citations
