Interactive Functional Programs: a Method and a Formal Semantics
Simon Thompson · Kent Academic Repository (University of Kent) · 1987
In this paper we present a model of interactive programs in a purely functional style. We exploit lazy evaluation in the modelling of streams as lazy lists. We show how programs may be constructed in an ad hoc way, and then present a small set of interactions and combinators which form the basis for a disciplined approach to writing such programs. One of the difficulties of the ad hoc approach is that the way in which input and output are interleaved by the functions can be unpredictable. In the second half of the paper we use traces, i.e. partial histories of behaviour, to explain the interleaving of input and output, and give a formal explanation of our combinators. We argue that this justifies our claim that the combinators have the intuitively expected behaviour, and finally contrast our approach with another. 1 Introduction This paper explains an approach to describing interactive processes in the lazy functional programming language Miranda 1 [6]. Functional programming is ba...
Cited by 12 works. Open-access PDF
Authors
References
- Communicating Sequential Processes
- Applications of temporal logic to the specification and verification of reactive systems: A survey of current trends
- Miranda: A non-strict functional language with polymorphic types
- The semantics of lazy (and industrious) evaluation
- Sacrificing simplicity for convenience: Where do you draw the line?