Results 11  20
of
44
A Monadic Framework for Delimited Continuations
 UNDER CONSIDERATION FOR PUBLICATION IN J. FUNCTIONAL PROGRAMMING
"... Delimited continuations are more expressive than traditional abortive continuations and they apparently require a framework beyond traditional continuationpassing style (CPS). We show that this is not the case: standard CPS is sufficient to explain the common control operators for delimited continu ..."
Abstract

Cited by 14 (2 self)
 Add to MetaCart
Delimited continuations are more expressive than traditional abortive continuations and they apparently require a framework beyond traditional continuationpassing style (CPS). We show that this is not the case: standard CPS is sufficient to explain the common control operators for delimited continuations. We demonstrate this fact and present an implementation as a Scheme library. We then investigate a typed account of delimited continuations that makes explicit where control effects can occur. This results in a monadic framework for typed and encapsulated delimited continuations, which we design and implement as a Haskell library.
A typetheoretic foundation of delimited continuations. Higher Order Symbol
 Comput
, 2009
"... Abstract. There is a correspondence between classical logic and programming language calculi with firstclass continuations. With the addition of control delimiters, the continuations become composable and the calculi become more expressive. We present a finegrained analysis of control delimiters a ..."
Abstract

Cited by 14 (6 self)
 Add to MetaCart
Abstract. There is a correspondence between classical logic and programming language calculi with firstclass continuations. With the addition of control delimiters, the continuations become composable and the calculi become more expressive. We present a finegrained analysis of control delimiters and formalise that their addition corresponds to the addition of a single dynamicallyscoped variable modelling the special toplevel continuation. From a type perspective, the dynamicallyscoped variable requires effect annotations. In the presence of control, the dynamicallyscoped variable can be interpreted in a purely functional way by applying a storepassing style. At the type level, the effect annotations are mapped within standard classical logic extended with the dual of implication, namely subtraction. A continuationpassingstyle transformation of lambdacalculus with control and subtraction is defined. Combining the translations provides a decomposition of standard CPS transformations for delimited continuations. Incidentally, we also give a direct normalisation proof of the simplytyped lambdacalculus with control and subtraction.
Handlers of Algebraic Effects
"... Abstract. We present an algebraic treatment of exception handlers and, more generally, introduce handlers for other computational effects representable by an algebraic theory. These include nondeterminism, interactive input/output, concurrency, state, time, and their combinations; in all cases the c ..."
Abstract

Cited by 13 (1 self)
 Add to MetaCart
Abstract. We present an algebraic treatment of exception handlers and, more generally, introduce handlers for other computational effects representable by an algebraic theory. These include nondeterminism, interactive input/output, concurrency, state, time, and their combinations; in all cases the computation monad is the freemodel monad of the theory. Each such handler corresponds to a model of the theory for the effects at hand. The handling construct, which applies a handler to a computation, is based on the one introduced by Benton and Kennedy, and is interpreted using the homomorphism induced by the universal property of the free model. This general construct can be used to describe previously unrelated concepts from both theory and practice. 1
Monads for Natural Language Semantics
"... Accounts of semantic phenomena often involve extending types of meanings and revising composition rules at the same time. The concept of monads allows many such accountsfor intensionality, variable binding, quantification and focusto be stated uniformly and compositionally. ..."
Abstract

Cited by 12 (0 self)
 Add to MetaCart
Accounts of semantic phenomena often involve extending types of meanings and revising composition rules at the same time. The concept of monads allows many such accountsfor intensionality, variable binding, quantification and focusto be stated uniformly and compositionally.
Purely Functional Lazy Nondeterministic Programming
"... Functional logic programming and probabilistic programming have demonstrated the broad benefits of combining laziness (nonstrict evaluation with sharing of the results) with nondeterminism. Yet these benefits are seldom enjoyed in functional programming, because the existing features for nonstric ..."
Abstract

Cited by 12 (3 self)
 Add to MetaCart
Functional logic programming and probabilistic programming have demonstrated the broad benefits of combining laziness (nonstrict evaluation with sharing of the results) with nondeterminism. Yet these benefits are seldom enjoyed in functional programming, because the existing features for nonstrictness, sharing, and nondeterminism in functional languages are tricky to combine. We present a practical way to write purely functional lazy nondeterministic programs that are efficient and perspicuous. We achieve this goal by embedding the programs into existing languages (such as Haskell, SML, and OCaml) with highquality implementations, by making choices lazily and representing data with nondeterministic components, by working with custom monadic data types and search strategies, and by providing equational laws for the programmer to reason about their code.
An Implementation of Transparent Migration on Standard Scheme
 Department of Computer Science, Rice University
, 2000
"... I present a handy (though somewhat restrictive) way to implement mobile computation a la Telescript on top of standard Scheme. Background. Mobile computation is an ecient and eective approach to distributed programming where a program works by migrating from one host to another. The migration is ca ..."
Abstract

Cited by 9 (0 self)
 Add to MetaCart
I present a handy (though somewhat restrictive) way to implement mobile computation a la Telescript on top of standard Scheme. Background. Mobile computation is an ecient and eective approach to distributed programming where a program works by migrating from one host to another. The migration is called transparent if the execution state of the program is preserved before and after the migration. Transparent migration is preferable to nontransparent, because it is easier to use for application programmers. At the same time, however, it is harder to implement for language developers: all existing implementations (to my knowledge) of transparent migration need either a custom runtime system (e.g. [13]) or global source code transformation (e.g. [12]). Our Method. In this presentation, I describe a library to enable transparent migration in standard Scheme. Unlike existing implementations, it requires neither modication of the runtime system nor transformation of the source code. It ...
A Generic TypeandEffect System
"... Typeandeffect systems are a natural approach for statically reasoning about a program’s execution. They have been used to track a variety of computational effects, for example memory manipulation, exceptions, and locking. However, each typeandeffect system is typically implemented as its own mon ..."
Abstract

Cited by 8 (0 self)
 Add to MetaCart
Typeandeffect systems are a natural approach for statically reasoning about a program’s execution. They have been used to track a variety of computational effects, for example memory manipulation, exceptions, and locking. However, each typeandeffect system is typically implemented as its own monolithic type system that hardcodes a particular syntax of effects along with particular rules to track and control those effects. We present a generic typeandeffect system, which is parameterized by the syntax of effects to track and by two functions that together specify the effect discipline to be statically enforced. We describe how a standard form of type soundness is ensured by requiring these two functions to obey a few natural monotonicity requirements. We demonstrate that several effect systems from the literature can be viewed as instantiations of our generic type system. Finally, we describe the implementation of our typeandeffect system and mechanically checked type soundness proof in the Twelf proof assistant.
Combining algebraic effects with continuations
, 2007
"... We consider the natural combinations of algebraic computational effects such as sideeffects, exceptions, interactive input/output, and nondeterminism with continuations. Continuations are not an algebraic effect, but previously developed combinations of algebraic effects given by sum and tensor ext ..."
Abstract

Cited by 8 (3 self)
 Add to MetaCart
We consider the natural combinations of algebraic computational effects such as sideeffects, exceptions, interactive input/output, and nondeterminism with continuations. Continuations are not an algebraic effect, but previously developed combinations of algebraic effects given by sum and tensor extend, with effort, to include commonly used combinations of the various algebraic effects with continuations. Continuations also give rise to a third sort of combination, that given by applying the continuations monad transformer to an algebraic effect. We investigate the extent to which sum and tensor extend from algebraic effects to arbitrary monads, and the extent to which Felleisen et al.’s C operator extends from continuations to its combination with algebraic effects. To do all this, we use Dubuc’s characterisation of strong monads in terms of enriched large Lawvere theories.
The Essence of Multitasking
 Proceedings of the 11th International Conference on Algebraic Methodology and Software Technology, volume 4019 of Lecture Notes in Computer Science
, 2006
"... Abstract. This article demonstrates how a powerful and expressive abstraction from concurrency theory—monads of resumptions—plays a dual rôle as a programming tool for concurrent applications. The article demonstrates how a wide variety of typical OS behaviors may be specified in terms of resumption ..."
Abstract

Cited by 7 (4 self)
 Add to MetaCart
Abstract. This article demonstrates how a powerful and expressive abstraction from concurrency theory—monads of resumptions—plays a dual rôle as a programming tool for concurrent applications. The article demonstrates how a wide variety of typical OS behaviors may be specified in terms of resumption monads known heretofore exclusively in the literature of programming language semantics. We illustrate the expressiveness of the resumption monad with the construction of an exemplary multitasking kernel in the pure functional language Haskell. 1
A Modal Calculus for Effect Handling
, 2003
"... In their purest formulation, monads are used in functional programming for two purposes: (1) to hygienically propagate effects, and (2) to globalize the effect scope  once an effect occurs, the purity of the surrounding computation cannot be restored. As a consequence, monadic typing does not prov ..."
Abstract

Cited by 6 (1 self)
 Add to MetaCart
In their purest formulation, monads are used in functional programming for two purposes: (1) to hygienically propagate effects, and (2) to globalize the effect scope  once an effect occurs, the purity of the surrounding computation cannot be restored. As a consequence, monadic typing does not provide very naturally for the practically important ability to handle effects, and there is a number of previous works directed toward remedying this deficiency. It is mostly based on extending the monadic framework with further extralogical constructs to support handling. In this paper we adopt...