|
ABSTRACT
The 'Scrap your boilerplate' approach to generic programming allows the programmer to write generic functions that can traverse arbitrary data structures, and yet have type-specific cases. However, the original approach required all the type-specific cases to be supplied at once, when the recursive knot of generic function definition is tied. Hence, generic functions were closed. In contrast, Haskell's type classes support open, or extensible, functions that can be extended with new type-specific cases as new data types are defined. In this paper, we extend the 'Scrap your boilerplate' approach to support this open style. On the way, we demonstrate the desirability of abstraction over type classes, and the usefulness of recursive dictionarie.
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
|
|
 |
2
|
|
| |
3
|
L Cardelli. Amber. In G Cousineau, PL Curien, and B Robinet, editors, Combinators and functional programming languages. LNCS 242, Springer Verlag, 1986.
|
 |
4
|
|
 |
5
|
|
 |
6
|
|
| |
7
|
|
| |
8
|
Simon D. Foster. "HAIFA: The Haskell Application Interoperation Framework Architecture"; web site, 2004--2005. http://www.repton-world.org.uk/mediawiki/index.php/HAIFA_Wiki.
|
 |
9
|
|
 |
10
|
|
| |
11
|
Ralf Hinze and Simon Peyton Jones. Derivable type classes. In Graham Hutton, editor, Proceedings of the 2000 Haskell Workshop, Montreal, number NOTTCS-TR-00-1 in Technical Reports, September 2000.
|
| |
12
|
RJM Hughes. Restricted data types in haskell. In Erik Meijer, editor, Proceedings of the 1999 Haskell Workshop, number UU-CS-1999-28 in Technical Reports, 1999. ftp://ftp.cs.uu.nl/pub/RUU/CS/techreps/CS-1999/1999-28.pdf.
|
 |
13
|
|
 |
14
|
Jeffrey R. Lewis , John Launchbury , Erik Meijer , Mark B. Shields, Implicit parameters: dynamic scoping with static types, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.108-118, January 19-21, 2000, Boston, MA, USA
[doi> 10.1145/325694.325708]
|
 |
15
|
|
 |
16
|
Ralf Lämmel , Simon Peyton Jones, Scrap more boilerplate: reflection, zips, and generalised casts, Proceedings of the ninth ACM SIGPLAN international conference on Functional programming, September 19-21, 2004, Snow Bird, UT, USA
|
| |
17
|
K Zhuo Ming Lu and M Sulzmann. An implementation of subtyping among regular expression types. In Proc Asian Programming Languages Symposium (APLAS'04), volume 3302 of Lecture Notes in Computer Science, pages 57--73. Springer Verlag, 2004.
|
| |
18
|
|
 |
19
|
|
| |
20
|
Konstantinos F. Sagonas, Terrance Swift, and David Scott Warren. An abstract machine for efficiently computing queries to well-founded models. J. Log. Program., 45(1--3):1--41, 2000.
|
 |
21
|
Dimitrios Vytiniotis , Geoffrey Washburn , Stephanie Weirich, An open and shut typecase, Proceedings of the 2005 ACM SIGPLAN international workshop on Types in languages design and implementation, p.13-24, January 10-10, 2005, Long Beach, California, USA
[doi> 10.1145/1040294.1040296]
|
 |
22
|
|
 |
23
|
|
CITED BY 15
|
|
|
|
|
|
|
|
|
|
|
Gustav Munkby , Andreas Priesnitz , Sibylle Schupp , Marcin Zalewski, Scrap++: scrap your boilerplate in C++, Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming, September 16-16, 2006, Portland, Oregon, USA
|
|
|
|
|
|
|
|
|
|
|
|
Paul Hudak , John Hughes , Simon Peyton Jones , Philip Wadler, A history of Haskell: being lazy with class, Proceedings of the third ACM SIGPLAN conference on History of programming languages, p.12-1-12-55, June 09-10, 2007, San Diego, California
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|