Functional Programming, Glasgow 1992

The interface with the outside world has always been one of the weakest points of functional languages. It is not easy to incorporate I/O without being alIowed to do side-effects. Furthermore, functional languages all ow redexes to be evaluated in any order while I/O generally has to be performed in a very specific order. In this paper we present a new solution for the I/O problem which we have incorporated in the language Concurrent Clean. Concurrent Clean offers a linear type system called Unique Types. It makes it possible to define functions with side-effects without violating the functional semantics. Now it is possible to change any object in the world in the way we wanted: e.g. arrays can be updated in-situ. arbitrary file manipulation is possible. We have used this powerful tool among others to create a library for window based I/O. Using an explicit environment passing scheme provides a high-level and elegant functional specification method for I/O, called Event I/O. Now the specification of I/O has become one of the strengths of functional languages: interactive programs written in Concurrent Clean are concise, easy to write and comprehend as weIl as efficient. The presented solution can in principle be applied for any other functional language as well provided that it actually uses graph rewriting semantics in the implementation.

[1]  Simon Peyton Jones,et al.  A practical technique for designing asynchronous finite-state machines , 1989 .

[2]  J. Michael Spivey A Categorial Approch to the Theory of Lists , 1989, MPC.

[3]  Anoop Gupta,et al.  SPLASH: Stanford parallel applications for shared-memory , 1992, CARN.

[4]  Larry Masinter,et al.  Performance of Lisp systems , 1982, LFP '82.

[5]  David A. Patterson,et al.  Computer Architecture: A Quantitative Approach , 1969 .

[6]  Lambert Meertens,et al.  Algorithmics : towards programming as a mathematical activity , 1986 .

[7]  Guy Argo Weighting Without Waiting: The Weighted Path Length Tree , 1991, Comput. J..

[8]  Colin Runciman,et al.  Heap Profiling of a Lazy Functional Compiler , 1992, Functional Programming.

[9]  M. Barr,et al.  Toposes, Triples and Theories , 1984 .

[10]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[11]  Ian H. Witten,et al.  Modeling for text compression , 1989, CSUR.

[12]  Michael Barr,et al.  Category theory for computing science , 1995, Prentice Hall International Series in Computer Science.

[13]  David Turner An approach to functional operating systems , 1990 .

[14]  Simon L. Peyton Jones,et al.  A modular fully‐lazy lambda lifter in Haskell , 1991, Softw. Pract. Exp..

[15]  Donald E. Knuth,et al.  Sorting and Searching , 1973 .

[16]  John Hughes,et al.  Why Functional Programming Matters , 1989, Comput. J..

[17]  D. A. Turner,et al.  A new implementation technique for applicative languages , 1979, Softw. Pract. Exp..

[18]  Edward B. Eichelberger,et al.  Hazard Detection in Combinational and Sequential Switching Circuits , 1964, IBM J. Res. Dev..

[19]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1990, Theor. Comput. Sci..

[20]  Graham Hutton,et al.  A calculational theory of pers as types , 1992 .

[21]  Robert E. Tarjan,et al.  Self-adjusting binary search trees , 1985, JACM.

[22]  Philip Wadler,et al.  Packrat parsing:: simple, powerful, lazy, linear time, functional pearl , 2002, ICFP '02.

[23]  Peter Aczel,et al.  An Introduction to Inductive Definitions , 1977 .

[24]  Philip Wadler,et al.  Comprehending monads , 1990, LISP and Functional Programming.

[25]  Thomas Johnsson,et al.  The Chalmers Lazy-ML Compiler , 1989, Computer/law journal.

[26]  Michael B. Smyth,et al.  Power Domains and Predicate Transformers: A Topological View , 1983, ICALP.

[27]  Gordon D. Plotkin,et al.  A Powerdomain Construction , 1976, SIAM J. Comput..

[28]  Jon Fairbairn,et al.  Non-Strict Languages - Programming and Implementation , 1989, Comput. J..

[29]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[30]  John Launchbury,et al.  A natural semantics for lazy evaluation , 1993, POPL '93.

[31]  Colin Runciman,et al.  Heap profiling of lazy functional programs , 1993, Journal of Functional Programming.

[32]  Richard S. Bird,et al.  An introduction to the theory of lists , 1987 .

[33]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[34]  Simon L. Peyton Jones,et al.  Unboxed Values as First Class Citizens in a Non-Strict Functional Language , 1991, FPCA.

[35]  Terry A. Welch,et al.  A Technique for High-Performance Data Compression , 1984, Computer.

[36]  Mark P. Jones A Theory of Qualified Types , 1992, ESOP.

[37]  Thomas M. Conte,et al.  A brief survey of benchmark usage in the architecture community , 1991, CARN.

[38]  Pieter H. Hartel Performance of lazy combinator graph reduction , 1991, Softw. Pract. Exp..

[39]  Giuseppe Fantauzzi An Algebraic Model for the Analysis of Logical Circuits , 1974, IEEE Transactions on Computers.

[40]  György E. Révész,et al.  Comparing Two Functional Programming Systems , 1989, IEEE Trans. Software Eng..

[41]  Simon L. Peyton Jones,et al.  Profiling Lazy Functional Programs , 1992, Functional Programming.

[42]  Matthew Hennessy,et al.  A Mathematical Semantics for a Nondeterministic Typed lambda-Calculus , 1980, Theor. Comput. Sci..

[43]  John T. O'Donnell,et al.  Hardware Description with Recursion Equations , 1987 .

[44]  Simon L. Peyton Jones,et al.  Implementing lazy functional languages on stock hardware: the Spineless Tagless G-machine , 1992, Journal of Functional Programming.

[45]  Tsung-Min Kuo,et al.  Strictness analysis: a new perspective based on type inference , 1989, FPCA.

[46]  Mats Carlsson,et al.  FUDGETS: a graphical user interface in a lazy functional language , 1993, FPCA '93.

[47]  Daniel W. Lewis Hazard detection by a quinary simulation of logic devices with bounded propagation delays , 1972, DAC '72.

[48]  Raymond T. Boute,et al.  Systems semantics: principles, applications, and implementation , 1988, TOPL.

[49]  S. Abramsky The lazy lambda calculus , 1990 .

[50]  Lynn Conway,et al.  Introduction to VLSI systems , 1978 .

[51]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[52]  ESOP '90 , 1990, Lecture Notes in Computer Science.

[53]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[54]  C. Hóre A Couple of Novelties in the Propositional Calculus , 1985 .

[55]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

[56]  J. Michael Spivey,et al.  A Functional Theory of Exceptions , 1990, Sci. Comput. Program..

[57]  Philip Wadler,et al.  Fixing some space leaks with a garbage collector , 1987, Softw. Pract. Exp..

[58]  Michael B. Smyth Power Domains , 1978, J. Comput. Syst. Sci..

[59]  Paul Hudak,et al.  Parametric type classes , 1992, LFP '92.

[60]  W. R. Stoye The implementation of functional languages using custom hardware , 1985 .

[61]  Harold W. Thimbleby,et al.  Equal Opportunity Interactive Systems , 1986, Int. J. Man Mach. Stud..

[62]  Simon Thompson,et al.  Formal Aspects of Computing , 1989 .

[63]  John McCarthy,et al.  A Basis for a Mathematical Theory of Computation1) , 1959 .

[64]  Mark P. Jones Qualified Types: Theory and Practice , 1994 .

[65]  Susan L. Graham,et al.  An execution profiler for modular programs , 1983, Softw. Pract. Exp..