|
ABSTRACT
Some type class instances can be automatically derived from the structure of types. As a result, the Haskell language includes the "deriving" mechanism to automatic generates such instances for a small number of built-in type classes. In this paper, we present RepLib, a GHC library that enables a similar mechanism for arbitrary type classes. Users of RepLib can define the relationship between the structure of a datatype and the associated instance declaration by a normal Haskell functions that pattern-matches a representation type. Furthermore, operations defined in this manner are extensible-instances for specific types not defined by type structure may also be incorporated. Finally, this library also supports the definition of operations defined by parameterized types.
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
|
James Cheney and Ralf Hinze. First-class phantom types. CUCIS TR2003-1901, Cornell University, 2003.
|
| |
3
|
Dave Clarke, Ralf Hinze, Johan Jeuring, Andres Löh, and Jan de Wit. The Generic Haskell user's guide. Technical Report UU-CS-2001-26, Utrecht University, 2001.
|
| |
4
|
|
 |
5
|
|
| |
6
|
DrIFT User Manual, April 2006. Available at http://repetae.net/~john/computer/haskell/DrIFT/.
|
| |
7
|
The GHC Team. The Glasgow Haskell Compiler User's Guide, version 5.02 edition, 2002. Available at http://www.haskell.org/ghc/.
|
 |
8
|
|
| |
9
|
|
 |
10
|
|
| |
11
|
Ralf Hinze and Simon Peyton Jones. Derivable type classes. In Graham Hutton, editor, Proceedings of the Fourth Haskell Workshop, Montreal, Canada, September 17, 2000, volume 41.1 of Electronic Notes in Theoretical Computer Science. Elsevier Science, August 2000.
|
| |
12
|
Ralf Hinze and Andres Löh. Scrap Your Boilerplate revolutions. In 8th International Conference on Mathematics of Program Construction, MPC 2006, Kuressaare, Estonia, July 2006.
|
| |
13
|
Ralf Hinze, Andres Löh, and Bruno C. d. S. Oliveira. Scrap Your Boilerplate reloaded. In Eighth International Symposium on Functional and Logic Programming, FLOPS 2006, April 2005.
|
| |
14
|
Ralf Hinze, Andres Löh, and Bruno C. d. S. Oliveira. Scrap Your Boilerplate reloaded (extended version). Technical report, 2005. Available at http://www.informatik.uni-bonn.de/~loeh/SYB0-TR.pdf.
|
| |
15
|
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.
|
| |
16
|
Stefan Holdermans, Johan Jeuring, Andres Löh, and Alexey Rodriguez. Generic views on data types. In 8th International Conference on Mathematics of Program Construction, MPC 2006, Kuressaare, Estonia, July 2006.
|
| |
17
|
John Hughes. Restricted datatypes in Haskell. In Haskell Workshop, number UU-CS-1999-28, 1999.
|
 |
18
|
|
| |
19
|
Wolfram Kahl and Jan Scheffczyk. Named instances for haskell type classes. In Haskell Workshop 2001, Firenze, Italy, September 2001.
|
 |
20
|
|
 |
21
|
|
 |
22
|
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
|
 |
23
|
|
 |
24
|
|
 |
25
|
|
 |
26
|
|
| |
27
|
Bruno C.d.S. Oliveira, Ralf Hinze, and Andres Löh. Generics as a library. In Seventh Symposium on Trends in Functional Programming, TFP 2006, Nottingham, UK, April 2006.
|
 |
28
|
Simon Peyton Jones , Dimitrios Vytiniotis , Stephanie Weirich , Geoffrey Washburn, Simple unification-based type inference for GADTs, Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming, September 16-21, 2006, Portland, Oregon, USA
|
| |
29
|
Simon L. Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Mark Shields. Practical type inference for arbitrary-rank types. Journal of Functional Programming, 2006. To appear.
|
 |
30
|
|
| |
31
|
Mark Shields and Simon Peyton Jones. Lexically scoped type variables. Microsoft Research, 2002.
|
 |
32
|
|
 |
33
|
|
| |
34
|
|
| |
35
|
|
| |
36
|
|
| |
37
|
Stephanie Weirich. Higher-order intensional type analysis in type erasure semantics, July 2003. At http://www.cis.upenn.edu/ ~sweirich/papers/erasure/erasure-paper-july03.pdf.
|
| |
38
|
|
| |
39
|
|
|