ACM Home Page
Please provide us with feedback. Feedback
Extensible programming with first-class cases
Full text PdfPdf (326 KB)
Source International Conference on Functional Programming archive
Proceedings of the eleventh ACM SIGPLAN international conference on Functional programming table of contents
Portland, Oregon, USA
SESSION: Session 10 table of contents
Pages: 239 - 250  
Year of Publication: 2006
ISBN:1-59593-309-3
Also published in ...
Authors
Matthias Blume  Toyota Technological Institute at Chicago
Umut A. Acar  Toyota Technological Institute at Chicago
Wonseok Chae  Toyota Technological Institute at Chicago
Sponsors
ACM: Association for Computing Machinery
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 2,   Downloads (12 Months): 41,   Citation Count: 0
Additional Information:

abstract   references   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/1159803.1159836
What is a DOI?

ABSTRACT

We present language mechanisms for polymorphic, extensible records and their exact dual, polymorphic sums with extensible first-class cases. These features make it possible to easily extend existing code with new cases. In fact, such extensions do not require any changes to code that adheres to a particular programming style. Using that style, individual extensions can be written independently and later be composed to form larger components. These language mechanisms provide a solution to the expression problem.We study the proposed mechanisms in the context of an implicitly typed, purely functional language PolyR. We give a type system for the language and provide rules for a 2-phase transformation: first into an explicitly typed λ-calculus with record polymorphism, and finally to efficient index-passing code. The first phase eliminates sums and cases by taking advantage of the duality with records.We implement a version of PolyR extended with imperative features and pattern matching - we call this language MLPolyR. Programs in MLPolyR require no type annotations - the implementation employs a reconstruction algorithm to infer all types. The compiler generates machine code (currently for PowerPC) and optimizes the representation of sums by eliminating closures generated by the dual construction.


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
A.W. Appel and D.B. MacQueen. Standard ML of New Jersey. In M. Wirsing, editor, 3rd International Symp. on Prog. Lang. Implementation and Logic Programming, pages 1--13, New York, Aug. 1991. Springer-Verlag.
3
 
4
K. Bruce. Some challenging typing issues in object-oriented languages. In Electronic notes in Theoretical Computer Science, volume 82(8), 2003.
 
5
6
7
 
8
9
 
10
J. Garrigue. Programming with polymorphic variants. In ACM SIGPLAN Workshop on ML, 1998.
 
11
J. Garrigue. Code reuse through polymorphic variants. In Workshop on Foundations of Software Engineering, Nov. 2000.
 
12
B.R. Gaster and M.P. Jones. A polymorphic type system for extensible records and variants. Technical Report NOTTCS-TR-96-3, Department of Computer Science, University of Nottingham, 1996.
 
13
K. Gowani and M. Blume. Writing a garbage collector for the MLPolyR compiler, July 2005. Final report on independent study project in the CSPP program.
 
14
M.P. Jones. Coherence for qualified types. Technical Report YALEU/DCS/RR-989, Yale University, New Haven, Connecticut, USA, 1993.
 
15
M.P. Jones and S.P. Jones. Lightweight extensible records for Haskell, 1999.
 
16
 
17
X. Leroy. {caml-list} cyclic types. http://caml.inria.fr/pub/ml-archives/caml-list/,Jan. 2005.
18
 
19
R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 13(3):348--375, 1978.
 
20
21
22
23
24
25
 
26
D. Rémy. Type inference for records in a natural extension of ML. Research Report 1431, Institut National de Recherche en Informatique et Automatisme, Rocquencourt, BP 105, 78 153 Le Chesnay Cedex, France, may 1991.
 
27
28
 
29
M. Torgersen. The expression problem revisited: Four new solutions using generics. In M. Odersky, editor, ECOOP 2004-Object-Oriented Programming, 18th European Conference, Oslo, Norway, Proceedings, volume 3086 of LNCS, pages 123--143, New York, NY, July 2004. Springer-Verlag.
 
30
P. Wadler. The expression problem. Email to the Java Genericity mailing list, Dec. 1998.
 
31
M. Wand. Complete type inference for simple objects. In Proceedings of the IEEE Symposium on Logic in Computer Science, Ithaca, NY, June 1987.
 
32
33
 
34
M. Zenger and M. Odersky. Independently extensible solutions to the expression problem. In The 12th International Workshop on Foundations of Object-Oriented Languages (FOOL 12), Long Beach, California, 2005. ACM.

Collaborative Colleagues:
Matthias Blume: colleagues
Umut A. Acar: colleagues
Wonseok Chae: colleagues