Results 1 - 10
of
295
Introduction to functional programming
, 1995
"... The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating e ects found in other languages, such as global state, exception handling, output, or non-determinism. Three case studies are looked at in detail: how monads ease the modi cation of ..."
Abstract
-
Cited by 1224 (37 self)
- Add to MetaCart
The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating e ects found in other languages, such as global state, exception handling, output, or non-determinism. Three case studies are looked at in detail: how monads ease the modi cation of a simple evaluator; how monads act as the basis of a datatype of arrays subject to in-place 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 I-terms. However, if one goes further and uses bn-conversion to prove equivalence of programs, then a gross simplification is introduced (programs are identified with ..."
Abstract
-
Cited by 651 (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 I-terms. However, if one goes further and uses bn-conversion 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 418 (11 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.
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 higher-order languages. Unlike the simple v -calculus, the extended theories are mixtures of equivalence relations and compatible congruen ..."
Abstract
-
Cited by 237 (35 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 higher-order 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 higher-order programming languages. The new theories subsume the original calculi of control and state and satisfy the usual Church-Rosser 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 -calculus-based programming languages provide imperative programming facilities such as assignment statements, exceptions, and continuations. Typical examples are ML [16], Schem...
A Foundation for Actor Computation
- Journal of Functional Programming
, 1998
"... We present an actor language which is an extension of a simple functional language, and provide a precise operational semantics for this extension. Actor configurations represent open distributed systems, by which we mean that the specification of an actor system explicitly takes into account the in ..."
Abstract
-
Cited by 198 (48 self)
- Add to MetaCart
We present an actor language which is an extension of a simple functional language, and provide a precise operational semantics for this extension. Actor configurations represent open distributed systems, by which we mean that the specification of an actor system explicitly takes into account the interface with external components. We study the composability of such systems. We define and study various notions of testing equivalence on actor expressions and configurations. The model we develop provides fairness. An important result is that the three forms of equivalence, namely, convex, must, and may equivalences, collapse to two in the presence of fairness. We further develop methods for proving laws of equivalence and provide example proofs to illustrate our methodology.
A Short Cut to Deforestation
, 1993
"... Lists are often used as "glue" to connect separate parts of a program together. We propose an automatic technique for improving the efficiency of such programs, by removing many of these intermediate lists, based on a single, simple, local transformation. We have implemented the method in the Glasgo ..."
Abstract
-
Cited by 173 (11 self)
- Add to MetaCart
Lists are often used as "glue" to connect separate parts of a program together. We propose an automatic technique for improving the efficiency of such programs, by removing many of these intermediate lists, based on a single, simple, local transformation. We have implemented the method in the Glasgow Haskell compiler.
A System of Constructor Classes: Overloading and Implicit Higher-Order Polymorphism
- Journal of functional programming
, 1995
"... This paper describes a flexible type system which combines overloading and higher-order polymorphism in an implicitly typed language using a system of constructor classes -- a natural generalization of type classes in Haskell. We present a wide range of examples which demonstrate the usefulness of ..."
Abstract
-
Cited by 171 (14 self)
- Add to MetaCart
This paper describes a flexible type system which combines overloading and higher-order polymorphism in an implicitly typed language using a system of constructor classes -- a natural generalization of type classes in Haskell. We present a wide range of examples which demonstrate the usefulness of such a system. In particular, we show how constructor classes can be used to support the use of monads in a functional language. The underlying type system permits higher-order polymorphism but retains many of many of the attractive features that have made the use of Hindley/Milner type systems so popular. In particular, there is an effective algorithm which can be used to calculate principal types without the need for explicit type or kind annotations. A prototype implementation has been developed providing, amongst other things, the first concrete implementation of monad comprehensions known to us at the time of writing. 1 An overloaded map function Many functional programs use the map ...
A Judgmental Reconstruction of Modal Logic
- Mathematical Structures in Computer Science
, 1999
"... this paper we reconsider the foundations of modal logic, following MartinL of's methodology of distinguishing judgments from propositions [ML85]. We give constructive meaning explanations for necessity (2) and possibility (3). This exercise yields a simple and uniform system of natural deduction for ..."
Abstract
-
Cited by 143 (37 self)
- Add to MetaCart
this paper we reconsider the foundations of modal logic, following MartinL of's methodology of distinguishing judgments from propositions [ML85]. We give constructive meaning explanations for necessity (2) and possibility (3). This exercise yields a simple and uniform system of natural deduction for intuitionistic modal logic which does not exhibit anomalies found in other proposals. We also give a new presentation of lax logic [FM97] and find that it is already contained in modal logic, using the decomposition of the lax modality fl A as
Higher-Order Modules and the Phase Distinction
- In Seventeenth ACM Symposium on Principles of Programming Languages
, 1990
"... Typed λ-calculus is an important tool in programming language research because it provides an extensible framework for studying language features both in isolation and in their relation to each other. In earlier work we introduced a predicative function calculus, XML, for modeling several asp ..."
Abstract
-
Cited by 130 (23 self)
- Add to MetaCart
Typed λ-calculus is an important tool in programming language research because it provides an extensible framework for studying language features both in isolation and in their relation to each other. In earlier work we introduced a predicative function calculus, XML, for modeling several aspects of the Standard ML type system. Following MacQueen, our study focused on the use of dependent types to represent the modularity constructs of Standard ML. In addition to shedding some light on the trade-offs between language features, our analysis suggested that the first-order modules system of ML could be naturally extended to higher orders. However, whereas ML maintains a clear distinction between compile-time and run-time in both its implementation and formal semantics, the XML calculus blurs this distinction. Since static type checking is, in our view, essential to the practical utility of ML, we introduce a refinement of the XML calculus for which type checking is decidable at compile time....
The Glasgow Haskell compiler: a technical overview
, 1992
"... We give an overview of the Glasgow Haskell compiler, focusing especially on way in which we have been able to exploit the rich theory of functional languages to give very practical improvements in the compiler. The compiler is portable, modular, generates good code, and is freely available. 1 Introd ..."
Abstract
-
Cited by 115 (18 self)
- Add to MetaCart
We give an overview of the Glasgow Haskell compiler, focusing especially on way in which we have been able to exploit the rich theory of functional languages to give very practical improvements in the compiler. The compiler is portable, modular, generates good code, and is freely available. 1 Introduction Computer Science is both a scientific and an engineering discipline. As a scientific discipline, it seeks to establish generic principles and theories that can be used to explain or underpin a variety of particular applications. As an engineering discipline, it constructs substantial artefacts of software and hardware, sees where they fail and where they work, and develops new theory to underpin areas that are inadequately supported. (Milner [1991] eloquently argues for this dual approach in Computer Science. ) Functional programming is a research area that offers an unusually close interplay between these two aspects (Peyton Jones [1992b]). Theory often has immediate practical appl...

