Results 1  10
of
34
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 456 (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.
A System of Constructor Classes: Overloading and Implicit HigherOrder Polymorphism
 Journal of functional programming
, 1995
"... This paper describes a flexible type system which combines overloading and higherorder 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 178 (14 self)
 Add to MetaCart
This paper describes a flexible type system which combines overloading and higherorder 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 higherorder 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 ...
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 96 (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.
Functional Programming with Overloading and HigherOrder Polymorphism
, 1995
"... The Hindley/Milner type system has been widely adopted as a basis for statically typed functional languages. One of the main reasons for this is that it provides an elegant compromise between flexibility, allowing a single value to be used in different ways, and practicality, freeing the progr ..."
Abstract

Cited by 70 (3 self)
 Add to MetaCart
The Hindley/Milner type system has been widely adopted as a basis for statically typed functional languages. One of the main reasons for this is that it provides an elegant compromise between flexibility, allowing a single value to be used in different ways, and practicality, freeing the programmer from the need to supply explicit type information. Focusing on practical applications rather than implementation or theoretical details, these notes examine a range of extensions that provide more flexible type systems while retaining many of the properties that have made the original Hindley/Milner system so popular. The topics discussed, some old, but most quite recent, include higherorder polymorphism and type and constructor class overloading. Particular emphasis is placed on the use of these features to promote modularity and reusability.
A Systematic Approach to Static Access Control
, 2001
"... ... This paper develops type systems which can statically guarantee the success of these checks. Our systems allow security properties of programs to be clearly expressed within the types themselves, which thus serve as static declarations of the security policy. We develop these systems using a sys ..."
Abstract

Cited by 69 (10 self)
 Add to MetaCart
... This paper develops type systems which can statically guarantee the success of these checks. Our systems allow security properties of programs to be clearly expressed within the types themselves, which thus serve as static declarations of the security policy. We develop these systems using a systematic methodology: we show that the securitypassing style translation, proposed by Wallach, Appel and Felten as a dynamic implementation technique, also gives rise to static securityaware type systems, by composition with conventional type systems. To de ne the latter, we use the general HM(X) framework, and easily construct several constraint and unificationbased type systems.
Composing Monads
, 1993
"... Monads are becoming an increasingly important tool for functional programming. Different monads can be used to model a wide range of programming language features. However, real programs typically require a combination of different features, so it is important to have techniques for combining severa ..."
Abstract

Cited by 68 (4 self)
 Add to MetaCart
Monads are becoming an increasingly important tool for functional programming. Different monads can be used to model a wide range of programming language features. However, real programs typically require a combination of different features, so it is important to have techniques for combining several features in a single monad. In practice, it is usually possible to construct a monad that supports some specific combination of features. However, the techniques used are typically adhoc and it is very difficult to find general techniques for combining arbitrary monads. This report gives three general constructions for the composition of monads, each of which depends on the existence of an auxiliary function linking the monad structures of the components. In each case, we establish a set of laws that the auxiliary function must satisfy to ensure that the composition is itself a monad. Using the notation of constructor classes, we describe some specific applications of these constructions. These results are used in the development of a simple expression evaluator that combines exceptions, output and an environment of variable bindings using a composition of three corresponding monads. 1
Computational types from a logical perspective
 Journal of Functional Programming
, 1998
"... Moggi’s computational lambda calculus is a metalanguage for denotational semantics which arose from the observation that many different notions of computation have the categorical structure of a strong monad on a cartesian closed category. In this paper we show that the computational lambda calculus ..."
Abstract

Cited by 54 (6 self)
 Add to MetaCart
Moggi’s computational lambda calculus is a metalanguage for denotational semantics which arose from the observation that many different notions of computation have the categorical structure of a strong monad on a cartesian closed category. In this paper we show that the computational lambda calculus also arises naturally as the term calculus corresponding (by the CurryHoward correspondence) to a novel intuitionistic modal propositional logic. We give natural deduction, sequent calculus and Hilbertstyle presentations of this logic and prove strong normalisation and confluence results. 1
A Semantics for Imprecise Exceptions
 In SIGPLAN Conference on Programming Language Design and Implementation
, 1999
"... Some modern superscalar microprocessors provide only imprecise exceptions. That is, they do not guarantee to report the same exception that would be encountered by a straightforward sequential execution of the program. In exchange, they offer increased performance or decreased chip area (which amoun ..."
Abstract

Cited by 52 (6 self)
 Add to MetaCart
Some modern superscalar microprocessors provide only imprecise exceptions. That is, they do not guarantee to report the same exception that would be encountered by a straightforward sequential execution of the program. In exchange, they offer increased performance or decreased chip area (which amount to much the same thing). This performance/precision tradeoff has not so far been much explored at the programming language level. In this paper we propose a design for imprecise exceptions in the lazy functional programming language Haskell. We discuss several designs, and conclude that imprecision is essential if the language is still to enjoy its current rich algebra of transformations. We sketch a precise semantics for the language extended with exceptions. The paper shows how to extend Haskell with exceptions without crippling the language or its compilers. We do not yet have enough experience of using the new mechanism to know whether it strikes an appropriate balance between expressiveness and pwrformance.
Semantic Lego
, 1995
"... Denotational semantics [Sch86] is a powerful framework for describing programming languages; however, its descriptions lack modularity: conceptually independent language features influence each others' semantics. We address this problem by presenting a theory of modular denotational semantics. Follo ..."
Abstract

Cited by 35 (0 self)
 Add to MetaCart
Denotational semantics [Sch86] is a powerful framework for describing programming languages; however, its descriptions lack modularity: conceptually independent language features influence each others' semantics. We address this problem by presenting a theory of modular denotational semantics. Following Mosses [Mos92], we divide a semantics into two parts, a computation ADT and a language ADT (abstract data type). The computation ADT represents the basic semantic structure of the language. The language ADT represents the actual language constructs, as described by a grammar. We define the language ADT using the computation ADT; in fact, language constructs are polymorphic over many different computation ADTs. Following Moggi [Mog89a], we build the computation ADT from composable parts, using monads and monad transformers. These techniques allow us to build many different computation ADTs, and, since our language constructs are polymorphic, many different language semantics. We autom...
Typed Generic Traversal With Term Rewriting Strategies
 Journal of Logic and Algebraic Programming
, 2002
"... A typed model of strategic term rewriting is developed. The key innovation is that generic. The calculus traversal is covered. To this end, we define a typed rewriting calculus S ′ γ employs a manysorted type system extended by designated generic strategy types γ. We consider two generic strategy t ..."
Abstract

Cited by 26 (8 self)
 Add to MetaCart
A typed model of strategic term rewriting is developed. The key innovation is that generic. The calculus traversal is covered. To this end, we define a typed rewriting calculus S ′ γ employs a manysorted type system extended by designated generic strategy types γ. We consider two generic strategy types, namely the types of typepreserving and typeunifying strategies. S ′ γ offers traversal combinators to construct traversals or schemes thereof from manysorted and generic strategies. The traversal combinators model different forms of onestep traversal, that is, they process the immediate subterms of a given term without anticipating any scheme of recursion into terms. To inhabit generic types, we need to add a fundamental combinator to lift a manysorted strategy s to a generic type γ. This step is called strategy extension. The semantics of the corresponding combinator states that s is only applied if the type of the term at hand fits, otherwise the extended strategy fails. This approach dictates that the semantics of strategy application must be typedependent to a certain extent. Typed strategic term rewriting with coverage of generic term traversal is a simple but expressive model of generic programming. It has applications in program