Results 1 
6 of
6
Parameterised notions of computation
 In MSFP 2006: Workshop on mathematically structured functional programming, ed. Conor McBride and Tarmo Uustalu. Electronic Workshops in Computing, British Computer Society
, 2006
"... Moggi’s Computational Monads and Power et al’s equivalent notion of Freyd category have captured a large range of computational effects present in programming languages such as exceptions, sideeffects, input/output and continuations. We present generalisations of both constructs, which we call para ..."
Abstract

Cited by 38 (3 self)
 Add to MetaCart
Moggi’s Computational Monads and Power et al’s equivalent notion of Freyd category have captured a large range of computational effects present in programming languages such as exceptions, sideeffects, input/output and continuations. We present generalisations of both constructs, which we call parameterised monads and parameterised Freyd categories, that also capture computational effects with parameters. Examples of such are composable continuations, sideeffects where the type of the state varies and input/output where the range of inputs and outputs varies. By also considering monoidal parameterisation, we extend the range of effects to cover separated sideeffects and multiple independent streams of I/O. We also present two typed λcalculi that soundly and completely model our categorical definitions — with and without monoidal parameterisation — and act as prototypical languages with parameterised effects.
Monadic augment and generalised short cut fusion
 Journal of Functional Programming
, 2005
"... Monads are commonplace programming devices that are used to uniformly structure computations with effects such as state, exceptions, and I/O. This paper further develops the monadic programming paradigm by investigating the extent to which monadic computations can be optimised by using generalisatio ..."
Abstract

Cited by 16 (7 self)
 Add to MetaCart
(Show Context)
Monads are commonplace programming devices that are used to uniformly structure computations with effects such as state, exceptions, and I/O. This paper further develops the monadic programming paradigm by investigating the extent to which monadic computations can be optimised by using generalisations of short cut fusion to eliminate monadic structures whose sole purpose is to “glue together ” monadic program components. We make several contributions. First, we show that every inductive type has an associated build combinator and an associated short cut fusion rule. Second, we introduce the notion of an inductive monad to describe those monads that give rise to inductive types, and we give examples of such monads which are widely used in functional programming. Third, we generalise the standard augment combinators and cata/augment fusion rules for algebraic data types to types induced by inductive monads. This allows us to give the first cata/augment rules for some common data types, such as rose trees. Fourth, we demonstrate the practical applicability of our generalisations by providing Haskell implementations for all concepts and examples in the paper. Finally, we offer deep theoretical insights by showing that the augment combinators are monadic in nature, and thus that our cata/build and cata/augment rules are arguably the best generally applicable fusion rules obtainable.
Kleisli arrows of outrageous fortune
, 2011
"... When we program to interact with a turbulent world, we are to some extent at its mercy. To achieve safety, we must ensure that programs act in accordance with what is known about the state of the world, as determined dynamically. Is there any hope to enforce safety policies for dynamic interaction b ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
When we program to interact with a turbulent world, we are to some extent at its mercy. To achieve safety, we must ensure that programs act in accordance with what is known about the state of the world, as determined dynamically. Is there any hope to enforce safety policies for dynamic interaction by static typing? This paper answers with a cautious ‘yes’. Monads provide a type discipline for effectful programming, mapping value types to computation types. If we index our types by data approximating the ‘state of the world’, we refine our values to witnesses for some condition of the world. Ordinary monads for indexed types give a discipline for effectful programming contingent on state, modelling the whims of fortune in way that Atkey’s indexed monads for ordinary types do not (Atkey, 2009). Arrows in the corresponding Kleisli category represent computations which a reach a given postcondition from a given precondition: their types are just specifications in a Hoare logic! By way of an elementary introduction to this approach, I present the example of a monad for interacting with a file handle which is either ‘open ’ or ‘closed’, constructed from a command interface specfied Hoarestyle. An attempt to open a file results in a state which is statically unpredictable but dynamically detectable. Well typed programs behave accordingly in either case. Haskell’s dependent type system, as exposed by the Strathclyde Haskell Enhancement preprocessor, provides a suitable basis for this simple experiment. 1
Chapter 1 Generalizing the AUGMENT Combinator
"... Abstract: The usual initial algebra semantics of inductive types provides a clear and uniform explanation for the FOLD combinator. In an APLAS 2004 paper [1], we described an alternative equivalent semantics of inductive types as limits of algebra structure forgetting functors. This gave us an elega ..."
Abstract
 Add to MetaCart
(Show Context)
Abstract: The usual initial algebra semantics of inductive types provides a clear and uniform explanation for the FOLD combinator. In an APLAS 2004 paper [1], we described an alternative equivalent semantics of inductive types as limits of algebra structure forgetting functors. This gave us an elegant universal property based account of the BUILD and AUGMENT combinators, which form the core of the shortcut deforestation program transformation method by Gill et al. [2, 3]. Here we present further evidence for the flexibility of our approach by showing that a useful AUGMENTlike combinator is definable for a far wider class of parameterized inductive types than free monads, namely for all monads arising from a parameterized monad via an initial algebra construction. 1.1
found at the ENTCS Macro Home Page. The Coinductive Resumption Monad
"... this file with prentcsmacro.sty for your meeting, ..."
(Show Context)
Generic Constraints for TypeSafe Embedded Programming
"... Domainspecific languages (DSLs) are everywhere, with applications in areas such as parser generation, music synthesis, parallel programming and even the design of domainspecific languages. However, while the payoff in using a DSL may be substantial, the cost of introducing a language may be mad ..."
Abstract
 Add to MetaCart
Domainspecific languages (DSLs) are everywhere, with applications in areas such as parser generation, music synthesis, parallel programming and even the design of domainspecific languages. However, while the payoff in using a DSL may be substantial, the cost of introducing a language may be made prohibitively high by the need to construct a supporting toolchain. A common tactic is to embed a DSL into a generalpurpose host programming language. Existing infrastructure such as a language’s compiler or type system may be reused, provided that the embedding accurately captures the properties of the DSL. While the rich type systems and orthogonal abstraction features of modern functional languages have proved particularly capable in this regard, they are not without their shortcomings. Building typesafe functions defined over an embedded DSL can introduce applicationspecific type constraints that end up being imposed on the DSL data types themselves. At best, these constraints are unwieldy and at worst they can limit the range of DSL expressions that can be built. In this thesis we tackle the problem of accurately embedding a DSL’s type system into that of the purely functional language Haskell. We present a framework for expressing applicationspecific constraints at the point of a DSL expression’s use rather than when the DSL’s embedding is defined. We show how our framework can be applied more generally to capture arbitrary properties of a DSL expression and, in certain cases, how we may subsequently prove additional safety properties such as the totality of a function which operates over DSL expressions. We evaluate our techniques by illustrating their use in constructing a DSL for heterogeneous parallel programming. However, our methods have potentially wider applications such as contextdependent computation, which are also discussed.