Type Families with Class, Type Classes with Family
- Alejandro Serrano,
- Jurriaan Hage,
- Utrecht University,
- ,
Research Output:
Conference Article in Proceeding or Book/Report chapter
Article in proceedings
Peer-reviewOpen access
Publication Information
Output type
Research Output:
Conference Article in Proceeding or Book/Report chapter
Article in proceedings
Peer-reviewOriginal language
Undefined/UnknownPages from-to (Number of pages)
Pages 129-140 (12 pages)Publication milestones
- Published - 01/09/2015
Publication status
Published - 01/09/2015
Place of publication
New York, NY, USAPublisher
Association for Computing Machinery, United StatesISBN (Print)
978-1-4503-3808-0Publication IDs
- Scopus: 84975733093
Host publication title
Proceedings of the 8th ACM SIGPLAN Symposium on HaskellAbstract
Type classes and type families are key ingredients in Haskell programming. Type classes were introduced to deal with ad-hoc polymorphism, although with the introduction of functional dependencies, their use expanded to type-level programming. Type families also allow encoding type-level functions, now as rewrite rules. This paper looks at the interplay of type classes and type families, and how to deal with shortcomings in both of them. Furthermore, we show how to use families to simulate classes at the type level. However, type families alone are not enough for simulating a central feature of type classes: elaboration, that is, generating code from the derivation of a rewriting. We look at ways to solve this problem in current Haskell, and propose an extension to allow elaboration during the rewriting phase.
Publication metrics
PlumX, opens in new tab
Captures
16
Citations
4
