Proceedings of the ACM on Programming Languages · 2017 · 31 citations · 18 references
ComputingComputer ScienceCompilersFormal MethodsProgramming LanguagesAbstract InterpretationContext-free LanguagesFunctional ProgrammingInterpreter DesignType CheckingType SystemsAbstract SemanticsAbstractionAbstraction MechanismsBidirectional Type CheckingInterpretersMonadic SemanticsMonadsType Parameterization
Understanding a program entails understanding its context; dependencies, configurations and even implementations are all forms of contexts. Modern programming languages and theorem provers offer an array of constructs to define contexts, implicitly. Scala offers implicit parameters which are used pervasively, but which cannot be abstracted over. This paper describes a generalization of implicit parameters to implicit function types , a powerful way to abstract over the context in which some piece of code is run. We provide a formalization based on bidirectional type-checking that closely follows the semantics implemented by the Scala compiler. To demonstrate their range of abstraction capabilities, we present several applications that make use of implicit function types. We show how to encode the builder pattern, tagless interpreters, reader and free monads and we assess the performance of the monadic structures presented.
18
Principal type-schemes for functional programs
Robin Milner · 1982 · 1.1K citations
How to make ad-hoc polymorphism less ad hoc
Philip Wadler, Stephen Blott · 1989 · 770 citations · Full text
Dependent types in practical programming
Hongwei Xi, Frank Pfenning · 1999 · 584 citations · Full text
Wouter Swierstra · Journal of Functional Programming · 2008 · 282 citations · Full text