Results 1  10
of
77
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 82 (4 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.
Modular Denotational Semantics for Compiler Construction
 In European Symposium on Programming
, 1996
"... . We show the benefits of applying modular monadic semantics to compiler construction. Modular monadic semantics allows us to define a language with a rich set of features from reusable building blocks, and use program transformation and equational reasoning to improve code. Compared to denotational ..."
Abstract

Cited by 66 (4 self)
 Add to MetaCart
. We show the benefits of applying modular monadic semantics to compiler construction. Modular monadic semantics allows us to define a language with a rich set of features from reusable building blocks, and use program transformation and equational reasoning to improve code. Compared to denotational semantics, reasoning in monadic style offers the added benefits of highly modularized proofs and more widely applicable results. To demonstrate, we present an axiomatization of environments, and use it to prove the correctness of a wellknown compilation technique. The monadic approach also facilitates generating code in various target languages with different sets of builtin features. 1 Introduction We propose a modular semantics which allows language designers to add (or remove) programming language features without causing global changes to the existing specification, derive a compilation scheme from semantic descriptions, prove the correctness of program transformation and compilation...
Recursive Monadic Bindings
, 2000
"... Monads have become a popular tool for dealing with computational effects in Haskell for two significant reasons: equational reasoning is retained even in the presence of effects; and program modularity is enhanced by hiding "plumbing" issues inside the monadic infrastructure. Unfortunately ..."
Abstract

Cited by 46 (4 self)
 Add to MetaCart
Monads have become a popular tool for dealing with computational effects in Haskell for two significant reasons: equational reasoning is retained even in the presence of effects; and program modularity is enhanced by hiding "plumbing" issues inside the monadic infrastructure. Unfortunately, not all the facilities provided by the underlying language are readily available for monadic computations. In particular, while recursive monadic computations can be defined directly using Haskell's builtin recursion capabilities, there is no natural way to express recursion over the values of monadic actions. Using examples, we illustrate why this is a problem, and we propose an extension to Haskell's donotation to remedy the situation. It turns out that the structure of monadic valuerecursion depends on the structure of the underlying monad. We propose an axiomatization of the recursion operation and provide a catalogue of definitions that satisfy our criteria.
Combining effects: sum and tensor
"... We seek a unified account of modularity for computational effects. We begin by reformulating Moggi’s monadic paradigm for modelling computational effects using the notion of enriched Lawvere theory, together with its relationship with strong monads; this emphasises the importance of the operations ..."
Abstract

Cited by 45 (5 self)
 Add to MetaCart
We seek a unified account of modularity for computational effects. We begin by reformulating Moggi’s monadic paradigm for modelling computational effects using the notion of enriched Lawvere theory, together with its relationship with strong monads; this emphasises the importance of the operations that produce the effects. Effects qua theories are then combined by appropriate bifunctors on the category of theories. We give a theory for the sum of computational effects, which in particular yields Moggi’s exceptions monad transformer and an interactive input/output monad transformer. We further give a theory of the commutative combination of effects, their tensor, which yields Moggi’s sideeffects monad transformer. Finally we give a theory of operation transformers, for redefining operations when adding new effects; we derive explicit forms for the operation transformers associated to the above monad transformers.
Deriving Backtracking Monad Transformers
 In The International Conference on Functional Programming (ICFP
, 2000
"... In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specication, where a specication consists of a signature and properties that the operations of the signature are required to satisfy. Briey, the rst technique, the term implementation, r ..."
Abstract

Cited by 42 (5 self)
 Add to MetaCart
In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specication, where a specication consists of a signature and properties that the operations of the signature are required to satisfy. Briey, the rst technique, the term implementation, represents the operations by terms and works by dening a mapping from operations to observations  this mapping can be seen as dening a simple interpreter. The second, the contextpassing implementation, represents operations as functions from their calling context to observations. We apply both techniques to derive a backtracking monad transformer that adds backtracking to an arbitrary monad. In addition to the usual backtracking operations  failure and nondeterministic choice  the prolog cut and an operation for delimiting the eect of a cut are supported. Categories and Subject Descriptors D.1.1 [Programming Techniques]: Applicative (Functional) Programming; D.3.2 [Programming La...
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. ..."
Abstract

Cited by 41 (0 self)
 Add to MetaCart
(Show Context)
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...
The essence of the Iterator pattern
 McBride, Conor, & Uustalu, Tarmo (eds), Mathematicallystructured functional programming
, 2006
"... The ITERATOR pattern gives a clean interface for elementbyelement access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that ..."
Abstract

Cited by 22 (7 self)
 Add to MetaCart
The ITERATOR pattern gives a clean interface for elementbyelement access to a collection. Imperative iterations using the pattern have two simultaneous aspects: mapping and accumulating. Various existing functional iterations model one or other of these, but not both simultaneously. We argue that McBride and Paterson’s idioms, and in particular the corresponding traverse operator, do exactly this, and therefore capture the essence of the ITERATOR pattern. We present some axioms for traversal, and illustrate with a simple example, the repmin problem.
Lightweight GUIs for Functional Programming
 In Proceedings of the Seventh International Symposium on Programming Languages, Implementations, Logics and Programs
, 1995
"... . Graphical user interfaces (GUIs) are hard to combine with functional programming. Using a suitable combination of monads, we are able to tame the imperative aspects of graphical I/O in a straightforward and elegant way. We present a concept to integrate lightweight GUIs into the functional framewo ..."
Abstract

Cited by 19 (1 self)
 Add to MetaCart
. Graphical user interfaces (GUIs) are hard to combine with functional programming. Using a suitable combination of monads, we are able to tame the imperative aspects of graphical I/O in a straightforward and elegant way. We present a concept to integrate lightweight GUIs into the functional framework, together with a library of basic functions and layout combinators to manipulate the GUI. An implementation of this library, using a set of highlevel graphical I/O routines, is outlined. Examples demonstrate the simple way in which applications can be written. 1 Introduction Everybody wants to use graphical user interfaces. And everybody wants to use functional programming languages. Unfortunately, these concepts are hard to combine: I/O, and graphical I/O in particular, is imperative in nature, and thus contradictory to the functional paradigm. Our goal is to reconcile these two concepts, by developing a framework in which a functional programmer smoothly can provide his program with a...
Monads as a theoretical foundation for AOP
 In International Workshop on AspectOriented Programming at ECOOP
, 1997
"... this paper is that much can be learned both about aspects and the aspect weaver if we think of the functional code as a monadic style program and we couch the different aspects into monads. The weaver then becomes a lifter to transform programs through different monads ..."
Abstract

Cited by 16 (1 self)
 Add to MetaCart
this paper is that much can be learned both about aspects and the aspect weaver if we think of the functional code as a monadic style program and we couch the different aspects into monads. The weaver then becomes a lifter to transform programs through different monads