Modular type classes

@inproceedings{Dreyer2007ModularTC,
  title={Modular type classes},
  author={Derek Dreyer and Robert Harper and Manuel M. T. Chakravarty and Gabriele Keller},
  booktitle={POPL '07},
  year={2007}
}
ML modules and Haskell type classes have proven to be highly effective tools for program structuring. Modules emphasize explicit configuration of program components and the use of data abstraction. Type classes emphasize implicit program construction and ad hoc polymorphism. In this paper, we show how the implicitly-typed style of type class programming may be supported within the framework of an explicitly-typed module language by viewing type classes as a particular mode of use of modules… Expand
Type classes as objects and implicits
TLDR
This paper presents a lightweight approach to type classes in object-oriented (OO) languages with generics using the CONCEPT pattern and implicits (a type-directed implicit parameter passing mechanism), making Scala ideally suited for generic programming in the large. Expand
Type Classes and Instance Chains: A Relational Approach
TLDR
This work proposes two improvements to existing class systems, and introduces several novel language features, instance chains and explicit failure, that increase the expressiveness of type classes while providing more direct expression of current idioms. Expand
Type Classes and Instance Chains: A Relational Approach
TLDR
This work proposes two improvements to existing class systems, and introduces several novel language features, instance chains and explicit failure, that increase the expressiveness of type classes while providing more direct expression of current idioms. Expand
Objects to Unify Type Classes and GADTs
We propose an Haskell-like language with the goal of unifying type classes and generalized algebraic datatypes(GADTs) into a single class construct. We treat classes as first-class types and we useExpand
The limitations of type classes as subtyped implicits (short paper)
TLDR
This paper describes instances of this problem and shows that they are not merely theoretical but often arise in practice, and discusses and compares the space of solutions to this problem in Scala today and in the future. Expand
Partial type constructors: or, making ad hoc datatypes less ad hoc
TLDR
The design is both simple and expressive: it supports partial datatypes as first-class citizens (including as instances of parametric abstractions, such as the Haskell Functor and Monad classes), and shows a simple type elaboration algorithm that avoids placing undue annotation burden on programmers. Expand
On the bright side of type classes: instance arguments in Agda
We present instance arguments: an alternative to type classes and related features in the dependently typed, purely functional programming language/proof assistant Agda. They are a new, general typeExpand
Principal Type Schemes for Modular Programs
TLDR
This work proposes a way of defining how type inference interacts with modules that is more liberal than any existing definition or implementation of SML and, moreover, admits a provably sound and complete typechecking algorithm via a straightforward generalization of Algorithm W. Expand
Familia: unifying interfaces, type classes, and family polymorphism
TLDR
It is shown that a deep unification can be achieved by generalizing the semantics of interfaces and classes, and the design of a programming language that incorporates this mechanism is described, using a core calculus, to show that the type system is sound. Expand
The implicit calculus: a new foundation for generic programming
TLDR
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. Expand
...
1
2
3
4
5
...

References

SHOWING 1-10 OF 55 REFERENCES
Named Instances for Haskell Type Classes
TLDR
A language extension that enhances the late binding capabilities of Haskell type classes, and provides more flexible means for type class instantiation, and presents a typed λ-calculus for this extension and provides a working prototype type checker on the basis of Mark Jones’ “Typing Haskell in Haskell”. Expand
Associated types with class
TLDR
This paper presents a type system that includes a type-directed translation into an explicitly typed target language akin to System F; the existence of this translation ensures that the addition of associated data types to an existing Haskell compiler only requires changes to the front end. Expand
Type Classes with Functional Dependencies
TLDR
The kind of problems that can occur with multiple parameter type classes are illustrated, and how they can be resolved by allowing programmers to specify explicit dependencies between the parameters are explained. Expand
Using parameterized signatures to express modular structure
TLDR
This paper presents a simple type-theoretic framework for modular programming using parameterized signatures, and using familiar concepts of polymorphism, the resulting module system is easy to understand and admits true separate compilation. Expand
A system of constructor classes: overloading and implicit higher-order polymorphism
TLDR
A flexible type system which combines overloading and higher-order polymorphism in an implicitly typed language using a system of constructor classes – a natural generalization of type classes in Haskell is described. Expand
Principal Type Schemes for Modular Programs
TLDR
This work proposes a way of defining how type inference interacts with modules that is more liberal than any existing definition or implementation of SML and, moreover, admits a provably sound and complete typechecking algorithm via a straightforward generalization of Algorithm W. Expand
Deciding type equivalence in a language with singleton kinds
TLDR
Inspired by Coquand's result for type theory, the decidability of constructor equivalence for λ&Pgr;&Sgr;S≤ is proved by exhibiting a novel — though slightly inefficient — type-directed comparison algorithm. Expand
A Theory of Qualified Types
TLDR
It is shown that the set of all possible typings for a given term can be characterized by a principal type scheme, calculated by a type inference algorithm. Expand
Essential language support for generic programming
TLDR
This paper presents the design of a type system and semantics for concepts that is suitable for non-type-inferencing languages and shares much in common with the type classes of Haskell, though the primary influence is from best practices in the C++ community. Expand
A type-theoretic approach to higher-order modules with sharing
TLDR
These problems are addressed from a type-theoretic viewpoint by considering a calculus based on Girard's system Fω that provides complete control over the propagation of compile-time information between program units and is sufficient to encode in a straightforward way most users of type sharing specifications in Standard ML. Expand
...
1
2
3
4
5
...