Title
Associated types with class
Abstract
Haskell's type classes allow ad-hoc overloading, or type-indexing, of functions. A natural generalisation is to allow type-indexing of data types as well. It turns out that this idea directly supports a powerful form of abstraction called associated types, which are available in C++ using traits classes. Associated types are useful in many applications, especially for self-optimising libraries that adapt their data representations and algorithms in a type-directed manner.In this paper, we introduce and motivate associated types as a rather natural generalisation of Haskell's existing type classes. Formally, we present 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.
Year
DOI
Venue
2005
10.1145/1040305.1040306
Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Keywords
Field
DocType
data type,front end,data representation,type system,indexation
Programming language,Computer science,System F,Type theory,Theoretical computer science,Compiler,Algebraic data type,Generalized algebraic data type,Data type,Haskell,Type family
Conference
Volume
Issue
ISSN
40
1
0362-1340
ISBN
Citations 
PageRank 
1-58113-830-X
57
2.75
References 
Authors
27
4
Name
Order
Citations
PageRank
Manuel M. T. Chakravarty166641.89
Gabriele Keller265736.02
Simon L. Peyton Jones35036381.19
Simon Marlow499655.48