Results 1  10
of
30
The Marriage of Effects and Monads
, 1998
"... this paper is to marry effects to monads, writing T for a computation that yields a value in and may have effects delimited by oe. Now we have that ( is ..."
Abstract

Cited by 120 (7 self)
 Add to MetaCart
this paper is to marry effects to monads, writing T for a computation that yields a value in and may have effects delimited by oe. Now we have that ( is
Monads and Effects
 IN INTERNATIONAL SUMMER SCHOOL ON APPLIED SEMANTICS APPSEM’2000
, 2000
"... A tension in language design has been between simple semantics on the one hand, and rich possibilities for sideeffects, exception handling and so on on the other. The introduction of monads has made a large step towards reconciling these alternatives. First proposed by Moggi as a way of structu ..."
Abstract

Cited by 76 (6 self)
 Add to MetaCart
(Show Context)
A tension in language design has been between simple semantics on the one hand, and rich possibilities for sideeffects, exception handling and so on on the other. The introduction of monads has made a large step towards reconciling these alternatives. First proposed by Moggi as a way of structuring semantic descriptions, they were adopted by Wadler to structure Haskell programs, and now offer a general technique for delimiting the scope of effects, thus reconciling referential transparency and imperative operations within one programming language. Monads have been used to solve longstanding problems such as adding pointers and assignment, interlanguage working, and exception handling to Haskell, without compromising its purely functional semantics. The course will introduce monads, effects and related notions, and exemplify their applications in programming (Haskell) and in compilation (MLj). The course will present typed metalanguages for monads and related categorica...
Monadic Regions
, 2004
"... Regionbased type systems provide programmer control over memory management without sacrificing typesafety. However, the type systems for regionbased languages, such as the MLKit or Cyclone, are relatively complicated, so proving their soundness is nontrivial. This paper shows that the complicati ..."
Abstract

Cited by 23 (2 self)
 Add to MetaCart
(Show Context)
Regionbased type systems provide programmer control over memory management without sacrificing typesafety. However, the type systems for regionbased languages, such as the MLKit or Cyclone, are relatively complicated, so proving their soundness is nontrivial. This paper shows that the complication is in principle unnecessary. In particular, we show that plain old parametric polymorphism, as found in Haskell, is all that is needed. We substantiate this claim by giving a type and meaningpreserving translation from a regionbased language based on core Cyclone to a monadic variant of System F with region primitives whose types and operations are inspired by (and generalize) the ST monad.
A Monadic Multistage Metalanguage
, 2003
"... We describe a metalanguage MMML, which makes explicit the order of evaluation (in the spirit of monadic metalanguages) and the staging of computations (as in languages for multilevel bindingtime analysis). The main contribution of the paper is an operational semantics which is sufficiently detaile ..."
Abstract

Cited by 17 (7 self)
 Add to MetaCart
(Show Context)
We describe a metalanguage MMML, which makes explicit the order of evaluation (in the spirit of monadic metalanguages) and the staging of computations (as in languages for multilevel bindingtime analysis). The main contribution of the paper is an operational semantics which is sufficiently detailed for analyzing subtle aspects of multistage programming, but also intuitive enough to serve as a reference semantics. For instance, the separation of computational types from code types, makes clear the distinction between a computation for generating code and the generated code, and provides a basis for multilingual extensions, where a variety of programming languages (aka monads) coexist. The operational semantics consists of two parts: local (semantics preserving) simplification rules, and computation steps executed in a deterministic order (because they may have sideeffects). We focus on the computational aspects, thus we adopt a simple type system, that can detect usual type errors, but not the unresolved link errors. Because of its explicit annotations, MMML is suitable as an intermediate language.
Syntax for free: Representing syntax with binding using parametricity
 OF LECTURE NOTES IN COMPUTER SCIENCE
, 2009
"... We show that, in a parametric model of polymorphism, the type ∀α.((α → α) → α) → (α → α → α) → α is isomorphic to closed de Bruijn terms. That is, the type of closed higherorder abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a mode ..."
Abstract

Cited by 17 (5 self)
 Add to MetaCart
(Show Context)
We show that, in a parametric model of polymorphism, the type ∀α.((α → α) → α) → (α → α → α) → α is isomorphic to closed de Bruijn terms. That is, the type of closed higherorder abstract syntax terms is isomorphic to a concrete representation. To demonstrate the proof we have constructed a model of parametric polymorphism inside the Coq proof assistant. The proof of the theorem requires parametricity over Kripke relations. We also investigate some variants of this representation.
Witnessing sideeffects
 In Proceedings of the 10th ACM SIGPLAN International Conference on Functional Programming. ACM
, 2005
"... We present a new approach to the old problem of adding global mutable state to purely functional languages. Our idea is to extend the language with “witnesses, ” which is based on an arguably more pragmatic motivation than past approaches. We give a semantic condition for correctness and prove it is ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
(Show Context)
We present a new approach to the old problem of adding global mutable state to purely functional languages. Our idea is to extend the language with “witnesses, ” which is based on an arguably more pragmatic motivation than past approaches. We give a semantic condition for correctness and prove it is sufficient. We also give a somewhat surprising static checking algorithm that makes use of a network flow property equivalent to the semantic condition via reduction to a satisfaction problem for a system of linear inequalities.
Recursion is a Computational Effect
, 2000
"... In a recent paper, Launchbury, Lewis, and Cook observe that some Haskell applications could benefit from a combinator mfix for expressing recursion over monadic types. We investigate three possible definitions of mfix and implement them in Haskell. Like traditional fixpoint operators, there are ..."
Abstract

Cited by 8 (1 self)
 Add to MetaCart
(Show Context)
In a recent paper, Launchbury, Lewis, and Cook observe that some Haskell applications could benefit from a combinator mfix for expressing recursion over monadic types. We investigate three possible definitions of mfix and implement them in Haskell. Like traditional fixpoint operators, there are two approaches to the definition of mfix: an unfolding one based on mathematical semantics, and an updating one based on operational semantics. The two definitions are equivalent in pure calculi but have different behaviors when used within monads. The unfolding version can be easily defined in Haskell if one restricts fixpoints to function types. The updating version is much more challenging to define in Haskell despite the fact that its definition is straightforward in Scheme. After studying the Scheme definition in detail, we mirror it in Haskell using the primitive unsafePerformIO. The resulting definition of mfix appears to work well but proves to be unsafe, in the sense that i...
Kleene Monads: Handling Iteration in a Framework of Generic Effects
"... Abstract. Monads are a wellestablished tool for modelling various computational effects. They form the semantic basis of Moggi’s computational metalanguage, the metalanguage of effects for short, which made its way into modern functional programming in the shape of Haskell’s donotation. Standard c ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
Abstract. Monads are a wellestablished tool for modelling various computational effects. They form the semantic basis of Moggi’s computational metalanguage, the metalanguage of effects for short, which made its way into modern functional programming in the shape of Haskell’s donotation. Standard computational idioms call for specific classes of monads that support additional control operations. Here, we introduce Kleene monads, which additionally feature nondeterministic choice and Kleene star, i.e. nondeterministic iteration, and we provide a metalanguage and a sound calculus for Kleene monads, the metalanguage of control and effects, which is the natural joint extension of Kleene algebra and the metalanguage of effects. This provides a framework for studying abstract program equality focussing on iteration and effects. These aspects are known to have decidable equational theories when studied in isolation. However, it is well known that decidability breaks easily; e.g. the Horn theory of continuous Kleene algebras fails to be recursively enumerable. Here, we prove several negative results for the metalanguage of control and effects; in particular, already the equational theory of the unrestricted metalanguage of control and effects over continuous Kleene monads fails to be recursively enumerable. We proceed to identify a fragment of this language which still contains both Kleene algebra and the metalanguage of effects and for which the natural axiomatisation is complete, and indeed the equational theory is decidable. 1
Monadic regions: Formal type soundness and correctness
, 2004
"... Drawing together two lines of research (that done in typesafe regionbased memory management and that done in monadic encapsuation of effects), we give a typepreserving translation from a variation of the region calculus of Tofte and Talpin into an extension of System F augmented with monadic type ..."
Abstract

Cited by 3 (3 self)
 Add to MetaCart
(Show Context)
Drawing together two lines of research (that done in typesafe regionbased memory management and that done in monadic encapsuation of effects), we give a typepreserving translation from a variation of the region calculus of Tofte and Talpin into an extension of System F augmented with monadic types and operations. Our source language is a novel region calculus, dubbed the Single Effect Calculus, in which sets of effects are specified by a single region representing an upper bound on the set. Our target language is F RGN, which provides an encapsulation operator whose parametric type ensures that regions (and values allocated therein) are neither accessible nor visible outside the appropriate scope. 1