Results 1  10
of
184
Monads for functional programming
, 1995
"... The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating effects found in other languages, such as global state, exception handling, output, or nondeterminism. Three case studies are looked at in detail: how monads ease the modification o ..."
Abstract

Cited by 1312 (37 self)
 Add to MetaCart
The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating effects found in other languages, such as global state, exception handling, output, or nondeterminism. Three case studies are looked at in detail: how monads ease the modification of a simple evaluator; how monads act as the basis of a datatype of arrays subject to inplace update; and how monads can be used to build parsers.
Notions of Computation and Monads
, 1991
"... The i.calculus is considered a useful mathematical tool in the study of programming languages, since programs can be identified with Iterms. However, if one goes further and uses bnconversion to prove equivalence of programs, then a gross simplification is introduced (programs are identified with ..."
Abstract

Cited by 733 (15 self)
 Add to MetaCart
The i.calculus is considered a useful mathematical tool in the study of programming languages, since programs can be identified with Iterms. However, if one goes further and uses bnconversion to prove equivalence of programs, then a gross simplification is introduced (programs are identified with total functions from calues to values) that may jeopardise the applicability of theoretical results, In this paper we introduce calculi. based on a categorical semantics for computations, that provide a correct basis for proving equivalence of programs for a wide range of notions of computation.
Comprehending Monads
 Mathematical Structures in Computer Science
, 1992
"... Category theorists invented monads in the 1960's to concisely express certain aspects of universal algebra. Functional programmers invented list comprehensions in the 1970's to concisely express certain programs involving lists. This paper shows how list comprehensions may be generalised to an arbit ..."
Abstract

Cited by 458 (13 self)
 Add to MetaCart
Category theorists invented monads in the 1960's to concisely express certain aspects of universal algebra. Functional programmers invented list comprehensions in the 1970's to concisely express certain programs involving lists. This paper shows how list comprehensions may be generalised to an arbitrary monad, and how the resulting programming feature can concisely express in a pure functional language some programs that manipulate state, handle exceptions, parse text, or invoke continuations. A new solution to the old problem of destructive array update is also presented. No knowledge of category theory is assumed.
Computational LambdaCalculus and Monads
, 1988
"... The calculus is considered an useful mathematical tool in the study of programming languages, since programs can be identified with terms. However, if one goes further and uses fijconversion to prove equivalence of programs, then a gross simplification 1 is introduced, that may jeopardise the ..."
Abstract

Cited by 441 (6 self)
 Add to MetaCart
The calculus is considered an useful mathematical tool in the study of programming languages, since programs can be identified with terms. However, if one goes further and uses fijconversion to prove equivalence of programs, then a gross simplification 1 is introduced, that may jeopardise the applicability of theoretical results to real situations. In this paper we introduce a new calculus based on a categorical semantics for computations. This calculus provides a correct basis for proving equivalence of programs, independent from any specific computational model. 1 Introduction This paper is about logics for reasoning about programs, in particular for proving equivalence of programs. Following a consolidated tradition in theoretical computer science we identify programs with the closed terms, possibly containing extra constants, corresponding to some features of the programming language under consideration. There are three approaches to proving equivalence of programs: ffl T...
The Revised Report on the Syntactic Theories of Sequential Control and State
 Theoretical Computer Science
, 1992
"... The syntactic theories of control and state are conservative extensions of the v calculus for equational reasoning about imperative programming facilities in higherorder languages. Unlike the simple v calculus, the extended theories are mixtures of equivalence relations and compatible congruen ..."
Abstract

Cited by 258 (36 self)
 Add to MetaCart
The syntactic theories of control and state are conservative extensions of the v calculus for equational reasoning about imperative programming facilities in higherorder languages. Unlike the simple v calculus, the extended theories are mixtures of equivalence relations and compatible congruence relations on the term language, which significantly complicates the reasoning process. In this paper we develop fully compatible equational theories of the same imperative higherorder programming languages. The new theories subsume the original calculi of control and state and satisfy the usual ChurchRosser and Standardization Theorems. With the new calculi, equational reasoning about imperative programs becomes as simple as reasoning about functional programs. 1 The syntactic theories of control and state Most calculusbased programming languages provide imperative programming facilities such as assignment statements, exceptions, and continuations. Typical examples are ML [16], Schem...
A FormulaeasTypes Notion of Control
 In Conference Record of the Seventeenth Annual ACM Symposium on Principles of Programming Languages
, 1990
"... The programming language Scheme contains the control construct call/cc that allows access to the current continuation (the current control context). This, in effect, provides Scheme with firstclass labels and jumps. We show that the wellknown formulaeastypes correspondence, which relates a constr ..."
Abstract

Cited by 235 (0 self)
 Add to MetaCart
The programming language Scheme contains the control construct call/cc that allows access to the current continuation (the current control context). This, in effect, provides Scheme with firstclass labels and jumps. We show that the wellknown formulaeastypes correspondence, which relates a constructive proof of a formula ff to a program of type ff, can be extended to a typed Idealized Scheme. What is surprising about this correspondence is that it relates classical proofs to typed programs. The existence of computationally interesting "classical programs"  programs of type ff, where ff holds classically, but not constructively  is illustrated by the definition of conjunctive, disjunctive, and existential types using standard classical definitions. We also prove that all evaluations of typed terms in Idealized Scheme are finite.
Dynamic typing in a statically typed language
 ACM Trans. Program. Lang. Syst
, 1991
"... Abstract. Dynamic typing can be useful in statically typed languages. We extend the simply typed λcalculus with dynamic typing and elaborate additional features like polymorphism and subtyping. 1 ..."
Abstract

Cited by 154 (4 self)
 Add to MetaCart
Abstract. Dynamic typing can be useful in statically typed languages. We extend the simply typed λcalculus with dynamic typing and elaborate additional features like polymorphism and subtyping. 1
On the Expressive Power of Programming Languages
 Science of Computer Programming
, 1990
"... The literature on programming languages contains an abundance of informal claims on the relative expressive power of programming languages, but there is no framework for formalizing such statements nor for deriving interesting consequences. As a first step in this direction, we develop a formal noti ..."
Abstract

Cited by 134 (4 self)
 Add to MetaCart
The literature on programming languages contains an abundance of informal claims on the relative expressive power of programming languages, but there is no framework for formalizing such statements nor for deriving interesting consequences. As a first step in this direction, we develop a formal notion of expressiveness and investigate its properties. To validate the theory, we analyze some widely held beliefs about the expressive power of several extensions of functional languages. Based on these results, we believe that our system correctly captures many of the informal ideas on expressiveness, and that it constitutes a foundation for further research in this direction. 1 Comparing Programming Languages The literature on programming languages contains an abundance of informal claims on the expressive power of programming languages. Arguments in these contexts typically assert the expressibility or nonexpressibility of programming constructs relative to a language. Unfortunately, pro...
How to Declare an Imperative
, 1995
"... How can we integrate interaction into a purely declarative language? This tutorial describes a solution to this problem based on a monad. The solution has been implemented in the functional language Haskell and the declarative language Escher. Comparisons are given to other approaches to interaction ..."
Abstract

Cited by 97 (3 self)
 Add to MetaCart
How can we integrate interaction into a purely declarative language? This tutorial describes a solution to this problem based on a monad. The solution has been implemented in the functional language Haskell and the declarative language Escher. Comparisons are given to other approaches to interaction based on synchronous streams, continuations, linear logic, and side effects.
Abstracting Control
 In Proceedings of the 1990 ACM Conference on LISP and Functional Programming
, 1990
"... The last few years have seen a renewed interest in continuations for expressing advanced control structures in programming languages, and new models such as Abstract Continuations have been proposed to capture these dimensions. This article investigates an alternative formulation, exploiting the lat ..."
Abstract

Cited by 95 (6 self)
 Add to MetaCart
The last few years have seen a renewed interest in continuations for expressing advanced control structures in programming languages, and new models such as Abstract Continuations have been proposed to capture these dimensions. This article investigates an alternative formulation, exploiting the latent expressive power of the standard continuationpassing style (CPS) instead of introducing yet other new concepts. We build on a single foundation: abstracting control as a hierarchy of continuations, each one modeling a specific language feature as acting on nested evaluation contexts. We show how iterating the continuationpassing conversion allows us to specify a wide range of control behavior. For example, two conversions yield an abstraction of Prologstyle backtracking. A number of other constructs can likewise be expressed i...