Results 1 -
2 of
2
Monadic Encapsulation of Effects: A Revised Approach (Extended Version)
- Journal of Functional Programming
, 1999
"... Launchbury and Peyton Jones came up with an ingenious idea for embedding regions of imperative programming in a pure functional language like Haskell. The key idea was based on a simple modification of Hindley-Milner's type system. Our first contribution is to propose a more natural encapsulation co ..."
Abstract
-
Cited by 27 (4 self)
- Add to MetaCart
Launchbury and Peyton Jones came up with an ingenious idea for embedding regions of imperative programming in a pure functional language like Haskell. The key idea was based on a simple modification of Hindley-Milner's type system. Our first contribution is to propose a more natural encapsulation construct exploiting higher-order kinds, which achieves the same encapsulation effect, but avoids the ad hoc type parameter of the original proposal. The second contribution is a type safety result for encapsulation of strict state using both the original encapsulation construct and the newly introduced one. We establish this result in a more expressive context than the original proposal, namely in the context of the higher-order lambda-calculus. The third contribution is a type safety result for encapsulation of lazy state in the higher-order lambda-calculus. This result resolves an outstanding open problem on which previous proof attempts failed. In all cases, we formalize the intended implementations as simple big-step operational semantics on untyped terms, which capture interesting implementation details not captured by the reduction semantics proposed previously. 1
Note on Algol and Conservatively Extending Functional Programming
, 1995
"... A simple Idealized Algol is considered, based on Reynolds's "essence of Algol." It is shown that observational equivalence in this language conservatively extends observational equivalence in its assignment-free functional sublanguage. 1 Introduction In "The essence of Algol," Reynolds (1981) prese ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
A simple Idealized Algol is considered, based on Reynolds's "essence of Algol." It is shown that observational equivalence in this language conservatively extends observational equivalence in its assignment-free functional sublanguage. 1 Introduction In "The essence of Algol," Reynolds (1981) presents a view of Algol as a call-byname language based on the typed -calculus, with "imperative" primitive types. A central feature of the design is the interaction between assignment and procedures. Side effects are wholly isolated in a primitive type comm of commands, and do not occur when computing a value of functional type. That is to say, side effects in procedures are latent, in the sense that an effect occurs only by evaluating a procedure call as a term of type comm. As a result, function types retain a genuine "functional character." For instance, the full fi and j laws are valid equivalences in Algol-like languages. This functional aspect of Algol has been emphasized strongly by Reyn...

