Derivable Type Classes
Ralf Thomas Walter Hinze, Simon Jones · Electronic Notes in Theoretical Computer Science · 2001
Generic programming allows you to write a function once, and use it many times at different types. A lot of good foundational work on generic programming has been done. The goal of this paper is to propose a practical way of supporting generic programming within the Haskell language, without radically changing the language or its type system. The key idea is to present generic programming as a richer language in which to write default method definitions in a class declaration. On the way, we came across a separate issue, concerning type-class overloading where higher kinds are involved. We propose a simple type-class system extension to allow the programmer to write richer contexts than is currently possible.
Cited by 114 works. doi:10.1016/s1571-0661(05)80542-0 Open-access PDF
Authors
References
- Purely Functional Data Structures
- Polymorphic type inference
- PolyP---a polytypic programming language extension
- Qualified Types : Theory and Practice
- Implicit parameters
- Type Classes with Functional Dependencies
- Generic Programming - An Introduction -
- A new approach to generic functional programming
- Compiling Haskell by program transformation: A report from the trenches
- Generic functional programming with types and relations