ACM Home Page
Please provide us with feedback. Feedback
Good advice for type-directed programming aspect-oriented programming and extensible generic functions
Full text PdfPdf (341 KB)
Source International Conference on Functional Programming archive
Proceedings of the 2006 ACM SIGPLAN workshop on Generic programming table of contents
Portland, Oregon, USA
SESSION: Session II table of contents
Pages: 33 - 44  
Year of Publication: 2006
ISBN:1-59593-492-6
Authors
Geoffrey Washburn  University of Pennsylvania
Stephanie Weirich  University of Pennsylvania
Sponsors
SIGPLAN: ACM Special Interest Group on Programming Languages
ACM: Association for Computing Machinery
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 4,   Downloads (12 Months): 49,   Citation Count: 4
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1159861.1159867
What is a DOI?

ABSTRACT

Type-directed programming is an important idiom for software design. In type-directed programming the behavior of programs is guided by the type structure of data. It makes it possible to implement many sorts of operations, such as serialization,traversals, and queries,only once and without needing to continually revise their implementations as new data types are defined.Type-directed programming is the basis for recent research into "scrapping" tedious boilerplate code that arises in functional programming with algebraic data types. This research has primarily focused on writing type-directed functions that are closed to extension. However, Lämmel and Peyton Jones recently developed a technique for writing openly extensible type-directed functions in Haskell by making clever use of type classes. Unfortunately, this technique has a number of limitations such as the inability to write specialized cases for existential or nested data types and function types becoming too constrained to be used as first-class functions.We present an alternate approach to writing openly extensible type-directed functions by using the aspect-oriented programming features provided by the language AspectML. Our solution not only avoids the limitations present in Lämmel and Peyton Jones's technique, but also allows type-directed functions to be extended at any time with cases for types that were not even known at compiletime. This capability is critical to writing programs that make use of dynamic loading or runtime type generativity.


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
P. Achten and R. Hinze. Combining generics and dynamics. Technical Report NIII-R0206, Nijmegen Institute for Computing and Information, July 2002.
 
3
4
 
5
D.S. Dantas, D. Walker, G. Washburn, and S. Weirich. AspectML: A polymorphic aspect-oriented functional programmming language (extended version). ACM Trans. Programming Languages and Systems. To appear pending revisions.Draft available at http://www.cis.upenn.edu/~geoffw/research/papers/aspect-toplas.pdf
 
6
 
7
R. Hinze and A. Löh. "Scrap your boilerplate" revolutions. In Proceedings of 8th Int. Conf. on Mathematics of Program Construction (MPC), 2006.
 
8
R. Hinze, A. Löh, and B.C. Oliveira. "Scrap your boilerplate" reloaded. In Proceedings of the 8th Int. Symp. on Functional and Logic Programming (FLOPS), pages 13--29, Fuji Susono,Japan,Apr.2006.
 
9
 
10
 
11
12
13
14
 
15
K. Läufer and M. Odersky. An extension of ML with first-class abstract types. In Proceedings of the SIGPLAN Workshop on ML and its Applications, pages 78--91,June 1992.
 
16
X. Leroy, D. Doligez, J. Garrigue, D. Rémy, and J. Vouillon. The Objective Caml System:Documentation and user's manual,2000. Available from http://caml.inria.fr
17
18
19
 
20
21
22
 
23
S. Peyton Jones.Haskell 98 Language and Libraries:The Revised Report. Cambridge University Press,2003.
 
24
25
 
26
G.D. Plotkin.A note on inductive generalization. In Machine Intelligence ,volume 5,pages 153--163.Edinburgh University Press, 1970.
 
27
J.C. Reynolds. Types, abstraction, and parametric polymorphism. Information processing ,pages 513--523,1983.
28
29
30
31
32
 
33
M. Wang,K.Chen,and S.-C.Khoo. On the pursuit of staticness and coherence. In Proceedings of the 5th Workshop on Foundations of Aspect-Oriented Languages (FOAL), Mar. 2006.
 
34
 
35
36
 
37
 
38
S. Weirich and L. Huang. A design for type-directed Java. In V. Bono, editor,Workshop on Object-Oriented Developments (WOOD), ENTCS, Aug. 2004. 20 pages.


Collaborative Colleagues:
Geoffrey Washburn: colleagues
Stephanie Weirich: colleagues