Abstract
Certain classes of applications are naturally described as a network of cooperating components, where each component reacts to input as and when it becomes available. This paper builds on previous work on expressing I/O and state-based algorithms safely in a functional language, and presents a new way of expressing reactive systems in a functional language that does not violate vital semantic properties. The approach taken is a pragmatic one in that it integrates constructs for expressing reactive systems within existing framework for writing I/O bound, state-based programs functionally.
The original contributions of this paper are twofold; first, we show how the existing monadic 1O model can be extended to cope with non-determinism, and secondly, we introduce primitives for evaluating I/O actions concurrently.
Supported by a Research Scholarship from the Royal Norwegian Research Council.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Peter Achten and Rinus Pasmeijer. Towards Distributed Interactive Programs in the Functional Programming Language Clean. In Implementation of Functional Programming Languages Workshop, University of East-Anglia, Norwich, September 1994.
Lennart Augustsson. Functional non-deterministic programming -or- How to make your own oracle. Technical Report ??, Chalmers University of Technology, March 1989.
Paul S. Barth, Rishiyur S. Nikhil, and Arvind. Non-strict, Functional Language with State. In J. Hughes, editor, Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture, volume 523 of Lecture Notes in Computer Science, pages 538–568. Springer Verlag, August 1991.
F. W. Burton. Nondeterminism with Referential Transparency in Functional Programming Languages. Computer Journal, 31 (3): 243–247, June 1988.
Magnus Carlsson and Thomas Hallgren. FUDGETS–A Graphical User Interface in a Lazy Functional Language. In ACM Conference on Functional Programming Languages and Computer Architecture, Pages 321–330. ACM Press, 1993.
William Clinger. Nondeterministic Call by Need is Neither Lazy Nor by Name. In Proceedings of the ACM Conference on Lisp and Functional Programming, pages 226–234, 1982.
John Cupitt. The Design and Implementation of an Operating System in a Functional Language. PhD thesis, Department of Computer Science, University of Kent at Canterbury, August 1992.
Peter Henderson. Purely Functional Operating Systems. In J. Darlington, P. Henderson, and D.A. Turner, editors, Functional Programming and its Applications, pages 177–192. Cambridge University Press, 1982.
Paul Hudak et al. Report on the Programming Language Haskell Version 1.2. ACM SIGPLAN Notices, 27 (5), May 1992.
John Hughes. Why Functional Programming Matters. Computer Journal, 32 (2): 98–107, April 1989.
John Hughes and John O’Donnell. Expressing and Reasoning About Non-deterministic Functional Programs. In Kei Davis and John Hughes, editors, Proceedings of the Glasgow Functional Workshop, pages 308–328, 1989.
Simon B. Jones and A. F. Sinclair. Functional Programming and Operating Systems. Computer Journal, 32 (2): 162–174, April 1989.
John Launchbury and Simon L. Peyton Jones. Lazy Functional State Threads. In Proceedings of the ACM Conference on Programming Language Design and Implementation, June 1994.
John Launchbury and Simon L Peyton Jones. State in Haskell. Lisp and Symbolic Computation,1994. to appear.
John McCarthy. A basic mathematical theory of computation. In P. Braffort and D. Hirschberg, editors, Computer Programming and Formal Systems, pages 33–70. North-Holland, Amsterdam, 1963.
Rob Noble and Colin Runciman. Concurrent Process Extensions to Gofer. unpublished, September 1994.
Nigel Perry. Towards a Concurrent Object/Process Oriented Functional Language. In Proceedings of the 15th Australian Compture Science Conference, 1992.
Simon L. Peyton Jones and Philip Wadler. Imperative Functional Programming. In ACM Conference on the Principles of Programming Languages, pages 71 — 84. ACM Press, January 1993.
Harald Sondergaard and Peter Sestoft. Referential Transparency, Definiteness and Unfoldability. Acta Informatica, 27: 505–517, 1990.
William Stoye. Message-Based Functional Operating Systems. Science of Computer Programming, 6: 291–311, 1986.
Philip Wadler. Comprehending Monads. In Proceedings of the ACM SIG-PLAN ‘80 Principles of Programming Languages Conference. ACM Press, June 1990.
Philip Wadler. The essence of functional programming. In Proceedings of the ACM SIGPLAN 19th Annual Symposium on Principles of Programming Languages,January 1992. Invited talk.
Malcolm Wallace and Colin Runciman. Type-checked message-passing between functional processes. In John O’Donnell and Kevin Hammond, editors, Glasgow Functional Programming Group Workshop, Ayr, September 1994. Springer Verlag.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1995 Springer-Verlag London
About this paper
Cite this paper
Finne, S., Jones, S.P. (1995). Programming Reactive Systems in Haskell. In: Hammond, K., Turner, D.N., Sansom, P.M. (eds) Functional Programming, Glasgow 1994. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3573-9_4
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3573-9_4
Publisher Name: Springer, London
Print ISBN: 978-3-540-19914-4
Online ISBN: 978-1-4471-3573-9
eBook Packages: Springer Book Archive