Lecture V - Type Classes
Lecture dates
7. 4. 2021 [motivation, introduction, compilation - till slide 14]
14. 4. 2021 [class hierarchy, constructor type classes, multi-parameter type classes, functional dependencies]
Reading
Primary papers
P. Wadler, S. Blott: How to make ad-hoc polymorphism less ad hoc. POPL'89. [PS]
The paper which introduced type classes. Still great place to start with type classes. You will recognize some material from the lecture.
M. Jones: Functional Programming with Overloading and Higher-Order Polymorphism. AFPT Spring School 1995. [PDF]
Sums up the qualified types and constructor classes. Very accessible.
Additional material
M. Jones: A theory of qualified types. ESOP’92.
The paper which introduced qualified types.
M. Jones: A system of constructor classes. FPCA’93.
Constructor classes were introduced here.
M. Jones: Type Classes with Functional Dependencies. ESOP'00.
Introduced the correct way of handling multiparameter type classes.
A History of Haskell: Being Lazy With Class. 2007. (Section 6) [PDF]
J. Peterson and M. Jones: Implementing Type Classes. PLDI'93. [PS]
C. Hall, K. Hammond, S. Peyton Jones, P. Wadler: Type classes in Haskell. ESOP'94. [PS]
Corresponding book chapters
- [RWH] chapter 6 "Using Typeclasses"
- [LYAH] chapter 3 (section Typeclasses 101), chapter 7 (section Typeclasses 102 and onwards)