ACM Home Page
Please provide us with feedback. Feedback
Boxes go bananas: encoding higher-order abstract syntax with parametric polymorphism
Full text PdfPdf (181 KB)
Source International Conference on Functional Programming archive
Proceedings of the eighth ACM SIGPLAN international conference on Functional programming table of contents
Uppsala, Sweden
Pages: 249 - 262  
Year of Publication: 2003
ISBN:1-58113-756-7
Also published in ...
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): 5,   Downloads (12 Months): 44,   Citation Count: 9
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/944705.944728
What is a DOI?

ABSTRACT

Higher-order abstract syntax is a simple technique for implementing languages with functional programming. Object variables and binders are implemented by variables and binders in the host language. By using this technique, one can avoid implementing common and tricky routines dealing with variables, such as capture-avoiding substitution. However, despite the advantages this technique provides, it is not commonly used because it is difficult to write sound elimination forms (such as folds or catamorphisms) for higher-order abstract syntax. To fold over such a datatype, one must either simultaneously define an inverse operation (which may not exist) or show that all functions embedded in the datatype are parametri.In this paper, we show how first-class polymorphism can be used to guarantee the parametricity of functions embedded in higher-order abstract syntax. With this restriction, we implement a library of iteration operators over data-structures containing functionals. From this implementation, we derive "fusion laws" that functional programmers may use to reason about the iteration operator. Finally, we show how this use of parametric polymorphism corresponds to the Schürmann, Despeyroux and Pfenning method of enforcing parametricity through modal types. We do so by using this library to give a sound and complete encoding of their calculus into System F?. This encoding can serve as a starting point for reasoning about higher-order structures in polymorphic languages.


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
C. Böhm and A. Berarducci. Automatic synthesis of typed ?-programs on term algebras. Theoretical Computer Science, 39:135--154, 1985.
 
4
A. Church. A formulation of the simple theory of types. Journal of Symbolic Logic, 5:56--68, 1940.
 
5
D. Clarke, R. Hinze, J. Jeuring, A. Löh, and J. de Wit. The Generic Haskell user's guide. Technical Report UU-CS-2001-26, Utrecht University, 2001.
 
6
O. Danvy and A. Filinski. Representing control: a study of the CPS transformation. Mathematical Structures in Computer Science, 2(4):361--391, Dec. 1992.
7
 
8
9
 
10
J.-Y. Girard. Une extension de l'interprétation de Gödel à l'analyse, et son application à l'élimination de coupures dans l'analyse et la théorie des types. In J. E. Fenstad, editor, Proceedings of the Second Scandinavian Logic Symposium, pages 63--92. North-Holland Publishing Co., 1971.
 
11
R. Hinze. Polytypic values possess polykinded types. Science of Computer Programming, 43(2--3):129--159, 2002. MPC Special Issue.
 
12
 
13
M. P. Jones. A system of constructor classes: overloading and implicit higher-order polymorphism. Journal of Functional Programming, 5(1), Jan. 1995.
 
14
 
15
16
 
17
D. Miller. An extension to ML to handle bound variables in data structures: Preliminary report. In Proceedings of the Logical Frameworks BRA Workshop, May 1990.
18
 
19
S. Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.
 
20
21
 
22
 
23
 
24
 
25
C. Schürmann, R. Fontana, and Y. Liao. Delphin: Functional programming with deductive systems. Available at http://cs-www.cs.yale.edu/homes/carsten/, 2002.
 
26
27
28
 
29
G. Washburn. Modal typing for specifying run-time code generation. Available from http://www.cis.upenn.edu/~geoffw/research/, 2001.
 
30
31

CITED BY  9

Collaborative Colleagues:
Geoffrey Washburn: colleagues
Stephanie Weirich: colleagues