A functional representation of data structures with a hole

Data structures with a hole, in other words data structures with an uninitialized field, are useful to write efficient programs: they enable us to construct functional data structures flexibly and write functions such as append and map as tail recursive functions. In this paper we present an approach to introducing data structures with a hole into call-by-value functional programming languages like ML. Data structures with a hole are formalized as a new form of ¿-abstraction called hole abstraction. The novel features of hole abstraction are that expressions inside hole abstraction are evaluated and application is implemented by destructive update of a hole. We present a simply typed call-by-value ¿-calculus extended with hole abstractions. Then we show a compilation method of hole abstraction and prove correctness of the compilation.

[1]  Paul Hudak,et al.  Single-threaded polymorphic lambda calculus , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[2]  Yasuhiko Minamide Compilation Based on a Calculus for Explicit Type Passing , 1996 .

[3]  Andrew P. Tolmach Tag-free garbage collection using explicit type parameters , 1994, LFP '94.

[4]  WadlerPhilip Is there a use for linear logic , 1991 .

[5]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[6]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

[7]  Robert Harper,et al.  TIL: a type-directed optimizing compiler for ML , 1996, PLDI '96.

[8]  Philip Wadler,et al.  A Taste of Linear Logic , 1993, MFCS.

[9]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[10]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[11]  Atsushi Ohori,et al.  A polymorphic record calculus and its compilation , 1995, TOPL.

[12]  Carl A. Gunter,et al.  Proving memory management invariants for a language based on linear logic , 1992, LFP '92.

[13]  Robert Harper,et al.  Typed closure conversion , 1996, POPL '96.

[14]  Gary Lindstrom,et al.  Functional programing and the logical variable , 1985, POPL.

[15]  Philip Lee Wadler Listlessness is better than laziness: an algorithm that transforms applicative programs to eliminate intermediate lists , 1984 .

[16]  Philip Wadler,et al.  Once upon a type , 1995, FPCA '95.

[17]  Bart Jacobs,et al.  Semantics of Weakening and Contraction , 1994, Ann. Pure Appl. Log..

[18]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[19]  Keshav Pingali,et al.  Lazy evaluation and the logic variable , 1988, ICS '88.

[20]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[21]  James R. Larus,et al.  Restructuring symbolic programs for concurrent execution on multiprocessors , 1989 .

[22]  Atsushi Ohori,et al.  A compilation method for ML-style polymorphic record calculi , 1992, POPL '92.