|
ABSTRACT
"Generics for the Masses" (GM) and "Scrap your Boilerplate" (SYB) are generic programming approaches based on some inenious applications of Haskell type classes. To achieve modularity, the GM and SYB approach have been extended by using some experimental language extensions such as abstraction over type classes and recursive instances. Hence, the type class encodings behind the GM and SYB approach become less practical and harder to understand.We show that none of these type class features are necessary if we use the single feature of extensible superclasses, the complement of subclass extension. We formalize type classes with extensible superclasses as the combination of a previously introduced type-passing translation scheme and a general type class framework. Our results shed some new light on the use of type classes to support generic programming.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
S. Abdennadher. Operational semantics and confluence of constraint propagation rules. In Proc. of CP'97, LNCS, pages 252--266. Springer-Verlag, 1997.
|
| |
2
|
|
| |
3
|
T. Frühwirth. Constraint handling rules. In Constraint Programming: Basics and Trends, LNCS. Springer-Verlag, 1995.
|
| |
4
|
Glasgow haskell compiler home page. http://www.haskell.org/ghc/.
|
 |
5
|
|
 |
6
|
|
 |
7
|
|
| |
8
|
F. Henderson et al. The Mercury language reference manual, 2001. http://www.cs.mu.oz.au/research/mercury/.
|
 |
9
|
|
| |
10
|
R. Hinze, A. Löh, and B. Oliveira. "Scrap your boilerplate" reloaded. In Proc. of FLOPS'06, volume 3945 of LNCS, pages 13--29. Springer-Verlag, 2006.
|
| |
11
|
J. Hughes. Restricted datatypes in Haskell. In Haskell Workshop, September 1999.
|
| |
12
|
Hugs home page. haskell.cs.yale.edu/hugs/.
|
 |
13
|
|
| |
14
|
D. Jeffery, F. Henderson, and Z. Somogyi. Type classes in Mercury. In J. Edwards, editor, Proc. Twenty-Third Australasian Computer Science Conf., volume 22 of Australian Computer Science Communications, pages 128--135. IEEE Computer Society Press, January 2000.
|
| |
15
|
Jhc. http://repetae.net/john/computer/jhc/.
|
 |
16
|
|
 |
17
|
|
 |
18
|
|
 |
19
|
|
 |
20
|
|
| |
21
|
B. Oliveira, R. Hinze, and A. Löh. Generics as a library. In Henrik Nilsson, editor, Seventh Symposium on Trends in Functional Programming, 2006.
|
| |
22
|
S. Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.
|
| |
23
|
M.J. Plasmeijer and M.C.J.D. van Eekelen. Language report Concurrent Clean. Technical Report CSI-R9816, Computing Science Institute, University of Nijmegen, Nijmegen, The Netherlands, June 1998. ftp://ftp.cs.kun.nl/pub/Clean/Clean13/doc/refman13.ps.gz.
|
| |
24
|
|
 |
25
|
|
 |
26
|
|
 |
27
|
|
 |
28
|
|
| |
29
|
M. Wang, K. Chen, and S-C Khoo. Coherent and type-directed weaving of aspect-oriented higher-order functional languages. http://www.comp.nus.edu.sg/~wangmeng, 2006. Manuscript.
|
| |
30
|
G. Washburn and S. Weirich. Good advice for type-directed programming, 2006. In this volume.
|
 |
31
|
Hongwei Xi , Chiyan Chen , Gang Chen, Guarded recursive datatype constructors, Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.224-235, January 15-17, 2003, New Orleans, Louisiana, USA
|
CITED BY 3
|
|
|
|
|
Jean-Philippe Bernardy , Patrik Jansson , Marcin Zalewski , Sibylle Schupp , Andreas Priesnitz, A comparison of c++ concepts and haskell type classes, Proceedings of the ACM SIGPLAN workshop on Generic programming, September 20-20, 2008, Victoria, BC, Canada
|
|
|
|
|