The implicit calculus
- 11 June 2012
- conference paper
- conference paper
- Published by Association for Computing Machinery (ACM) in Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation
- Vol. 47 (6), 35-44
- https://doi.org/10.1145/2254064.2254070
Abstract
Generic programming (GP) is an increasingly important trend in programming languages. Well-known GP mechanisms, such as type classes and the C++0x concepts proposal, usually combine two features: 1) a special type of interfaces; and 2) implicit instantiation of implementations of those interfaces. Scala implicits are a GP language mechanism, inspired by type classes, that break with the tradition of coupling implicit instantiation with a special type of interface. Instead, implicits provide only implicit instantiation, which is generalized to work for any types. This turns out to be quite powerful and useful to address many limitations that show up in other GP mechanisms. This paper synthesizes the key ideas of implicits formally in a minimal and general core calculus called the implicit calculus (λ⇒), and it shows how to build source languages supporting implicit instantiation on top of it. A novelty of the calculus is its support for partial resolution and higher-order rules (a feature that has been proposed before, but was never formalized or implemented). Ultimately, the implicit calculus provides a formal model of implicits, which can be used by language designers to study and inform implementations of similar mechanisms in their own languages.Keywords
This publication has 27 references indexed in Scilit:
- The implicit calculusPublished by Association for Computing Machinery (ACM) ,2012
- The C++0x “Concepts” EffortLecture Notes in Computer Science, 2012
- On the bright side of type classesPublished by Association for Computing Machinery (ACM) ,2011
- OutsideIn(X)Modular type inference with local assumptionsJournal of Functional Programming, 2011
- A language for generic programming in the largeScience of Computer Programming, 2011
- Scala for generic programmersJournal of Functional Programming, 2010
- First-Class Type ClassesLecture Notes in Computer Science, 2008
- Scrap your boilerplate with classPublished by Association for Computing Machinery (ACM) ,2005
- Derivable Type ClassesElectronic Notes in Theoretical Computer Science, 2001
- Type Inference for Overloading without Restrictions, Declarations or AnnotationsLecture Notes in Computer Science, 1999