Pure functional programming and imperative programming appear to be contradictory approaches to the design of programming languages. Pure functional programming insists that variables have unchanging bindings and that these bindings may be substituted freely for occurrences of the variables. Imperative programming, however, relies for its computational power on the alteration of variable bindings by the action of the program.
One particular approach to merging the two design principles into the same programming language introduces a notion of assignable variable distinct from that of functionally bound variable. In this approach, functional programming languages are extended with new syntactic constructs denoting sequences of actions, including assignment to and reading from assignable variables. Swarup, Reddy and Ireland have proposed a typed lambda-calculus in this style as a foundation for programming-language design. Launchbury has proposed to extend strongly-typed purely functional programming in this style in such a way that assignments are carried out lazily.
In this dissertation we extend and correct the work of Odersky, Rabin, and Hudak giving an untyped lambda-calculus as a formalism for designing functional programming languages having assignable variables. The extension encompasses two untyped calculi sharing a common core of syntactic constructs and rules corresponding to the similarities in all the typed proposals, and differing in ways that isolate the semantic differences between those proposals. We prove the consistency and suitability for implementation of the two calculi. We adapt a technique of Launchbury and Peyton Jones to provide a safe type system for the calculi we study, thus providing a correct replacement for systems, now known to be flawed, originally proposed by Swarup, Reddy, Ireland, Chen, and Odersky.
Cited By
- Semmelroth M and Sabry A Monadic encapsulation in ML Proceedings of the fourth ACM SIGPLAN international conference on Functional programming, (8-17)
- Semmelroth M and Sabry A (1999). Monadic encapsulation in ML, ACM SIGPLAN Notices, 34:9, (8-17), Online publication date: 1-Sep-1999.
- Launchbury J and Sabry A Monadic state Proceedings of the second ACM SIGPLAN international conference on Functional programming, (227-238)
- Launchbury J and Sabry A (1997). Monadic state, ACM SIGPLAN Notices, 32:8, (227-238), Online publication date: 1-Aug-1997.
Recommendations
Database query languages and functional logic programming
AbstractFunctional logic programming is a paradigm which integrates functional and logic programming. It is based on the use of rewriting rules for defining programs, and rewriting for goal solving. In this context, goals, usually, consist of equality (...
Using functional languages to facilitate C++ metaprogramming
WGP '12: Proceedings of the 8th ACM SIGPLAN workshop on Generic programmingTemplate and Preprocessor Metaprogramming are both well-known in the C++ community to have much in common with Functional Programming (FP). Recently, very few research threads on underpinning these commonalities have emerged to empower cross-development ...