Abstract
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 allowed to do side-effects. Furthermore, functional languages allow 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 well 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.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Achten PM. Operational Semantics of Clean Event I/O. Technical report - in preparation University of Nijmegen.
Backus J. Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs.In: Communications of the ACM, Vol.21 Nr. 8, 1978.
Backus J, Williams J, Wimmers E. An introduction to the programming language FL. In: Turner A (ed) Research topics in Functional Programming, Addison-Wesley Publishing Company, 1990.
Barendregt HP, Eekelen van MCJD, Glauwert JRW et al. `Term Graph Reduction’. In: Proceedings of Parallel Architectures and Languages Europe, Eindhoven, The Netherlands, LNCS 259, Vol. II. Springer-Verlag, Berlin, 1990, pp. 141–158.
Brus T, Eekelen van MCJD, Plasmeijer MJ and Barendregt HP. Clean–A Language for Functional Graph Rewriting. In: Proc. of Conference on Functional Programming Languages and Computer Architecture, Portland, Oregon, USA, Springer Verlag, LNCS 274, 1987, pp. 364–384.
Eekelen van MCJD, Huitema HS, Nöcker EGJMH, Smetsers JEW and Plasmeijer MJ. Concurrent Clean Language Manual - version 0.8. Technical report No. 92–18 Department of Informatics, Faculty of Mathematics and Informatics, University of Nijmegen 1992.
Girard J-Y. Linear Logic. In: Theoretical Computer Science 50. 1987, pp. 1–102.
Groningen van JHG, Nöcker EGJMH and Smetsers JEW. Efficient Heap Management in the Concrete ABC Machine. In: Proc. of Third International Workshop on Implementation of Functional Languages on Parallel Architectures. University of Southampton, UK 1991. Technical Report Series CSTR91–07.
Darlington P. Purely Functional Operating Systems. In: Darlington, Henderson, Turner (ed) Functional programming and its applications.
Dwelly A. Functions and Dynamic User Interfaces. In: Proc. of ACM 1989. pp. 371–381.
Hughes J. Why Functional Programming Matters. In: Turner DA (ed) Research topics in Functional Programming. Addison-Wesley Publishing Company, 1990.
Nöcker EGJMH, Smetsers JEW, Eekelen van MCJD and Plasmeijer MJ. Concurrent Clean. In: Proc. of Parallel Architectures and Languages Europe, Eindhoven, The Netherlands. Springer Verlag, LNCS 505. 1990. pp. 202–219.
Perry N. Functional I/O - a solution. Department of Computing, Imperial College, London, Draft version, July 1988.
Peyton Jones SL, Wadler Ph. Imperative Functional Programming. Extended Abstract, to appear in POPL 1993, University of Glasgow.
Pillich L. Portable Clean Event I/O. Department of informatics, Faculty of Mathematics and Informatics, University of Nijmegen. Master Thesis 230, July 1992.
Plasmeijer MJ, Eekelen van MCJD. Functional Programming and Parallel Graph Rewriting. Lecture notes. University of Nijmegen 1991/1992. To appear: Addison Wesley 1993.
Smetsers JEW, Nöcker EGJMH, Groningen van JHG and Plasmeijer MJ. Generating Efficient Code for Lazy Functional Languages. In: Proc. of Conference on Functional Programming Languages and Computer Architecture Cambridge, MA, USA, Springer Verlag, LNCS 523, 1991, pp. 592–617.
Smetsers JEW, Achten PM, Eekelen van MCJD and Plasmeijer MJ. An Unique Type Predicate and its Application for Efficient Code Generation for Functional Languages. Technical report - in preparation. University of Nijmegen.
Thompson S. Interactive Functional Programs. A Method and a Formal Semantics. In: Turner DA (ed) Research topics in Functional Programming, Addison-Wesley Publishing Company, University of Kent, 1990.
Turner DA. An Approach to Functional Operating Systems. In: Turner DA (ed) Research topics in Functional Programming, Addison-Wesley Publishing Company, University of Kent, 1990.
Wadler Ph. Linear types can change the world! In: Broy M, Jones CB (ed) Programming Concepts and Methods, North-Holland, 1990.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1993 British Computer Society
About this paper
Cite this paper
Achten, P., van Groningen, J., Plasmeijer, R. (1993). High Level Specification of I/O in Functional Languages. In: Launchbury, J., Sansom, P. (eds) Functional Programming, Glasgow 1992. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3215-8_1
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3215-8_1
Publisher Name: Springer, London
Print ISBN: 978-3-540-19820-8
Online ISBN: 978-1-4471-3215-8
eBook Packages: Springer Book Archive