Results 1  10
of
18
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 47 (6 self)
 Add to MetaCart
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...
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...
Combining Computational Effects: Commutativity and Sum
, 2002
"... We begin to develop a unified account of modularity for computational effects. We use the notion of enriched Lawvere theory, together with its relationship with strong monads, to reformulate Moggi's paradigm for modelling computational effects; we emphasise the importance here of the operations that ..."
Abstract

Cited by 19 (4 self)
 Add to MetaCart
We begin to develop a unified account of modularity for computational effects. We use the notion of enriched Lawvere theory, together with its relationship with strong monads, to reformulate Moggi's paradigm for modelling computational effects; we emphasise the importance here of the operations that induce computational effects. Effects qua theories are then combined by appropriate bifunctors (on the category of theories). We give a theory of the commutative combination of effects, which in particular yields Moggi's sideeffects monad transformer (an application is the combination of sideeffects with nondeterminism). And we give a theory...
Metalanguages and Applications
 Semantics and Logics of Computation, Publications of the Newton Institute
, 1995
"... syntax and encoding in LF In this section we introduce a logical framework with a cumulative hierarchy of predicative universes (in this way we don't need to distinguish between contexts and signatures ). Our main motivation for introducing a logical framework is to have precise and concise descrip ..."
Abstract

Cited by 12 (3 self)
 Add to MetaCart
syntax and encoding in LF In this section we introduce a logical framework with a cumulative hierarchy of predicative universes (in this way we don't need to distinguish between contexts and signatures ). Our main motivation for introducing a logical framework is to have precise and concise descriptions of (the wellformed expressions of) languages and translations: languages are described by signatures and translations by signature realizations. 3.1 The logical framework LF The logical framework is give by a set of inference rules for deriving judgements of the following forms: `, i.e. is a context ` A : Type i , i.e. A is a type (in the ith universe) in context ` M : A, i.e. M is a term of type A in context where M and A range over pseudoterms described by the following BNF: identiers x 2 Id ::= an innite set pseudoterms A; M 2 Exp ::= x j Type i j x : A 1 :A 2 j x : A:M j M 1 M 2 empty ; ` ext ` A : Type i ; x : A ` x 62 DV() type2 ` ` Type i : Type i+1 i...
Adjunction models for callbypushvalue with stacks
 Proceedings, 9th Conference on Category Theory and Computer Science, Ottawa, 2002, volume 69 of Electronic Notes in Theoretical Computer Science
, 2005
"... Callbypushvalue is a ”semantic machine code”, providing a set of simple primitives from which both the callbyvalue and callbyname paradigms are built. We present its operational semantics as a stack machine, suggesting a term judgement of stacks. We then see that CBPV, incorporating these st ..."
Abstract

Cited by 10 (6 self)
 Add to MetaCart
Callbypushvalue is a ”semantic machine code”, providing a set of simple primitives from which both the callbyvalue and callbyname paradigms are built. We present its operational semantics as a stack machine, suggesting a term judgement of stacks. We then see that CBPV, incorporating these stack terms, has a simple categorical semantics based on an adjunction between values and stacks. There are no coherence requirements. We describe this semantics incrementally. First, we introduce locally indexed categories and the opGrothendieck construction, and use these to give the basic structure for interpreting the three judgements: values, stacks and computations. Then we look at the universal property required to interpret each type constructor. We define a model to be a strong adjunction with countable coproducts, countable products and exponentials. We see a wide range of instances of this structure: we give examples for divergence, storage, erratic choice, continuations, possible worlds and games (with or without a bracketing condition), in each case resolving the strong monad from the literature into a strong adjunction. And we give ways of constructing models from other models. Finally, we see that callbyvalue and callbyname are interpreted within the Kleisli and coKleisli parts, respectively, of a callbypushvalue adjunction.
Countable Lawvere Theories and Computational Effects
, 2006
"... Lawvere theories have been one of the two main category theoretic formulations of universal algebra, the other being monads. Monads have appeared extensively over the past fifteen years in the theoretical computer science literature, specifically in connection with computational effects, but Lawvere ..."
Abstract

Cited by 10 (2 self)
 Add to MetaCart
Lawvere theories have been one of the two main category theoretic formulations of universal algebra, the other being monads. Monads have appeared extensively over the past fifteen years in the theoretical computer science literature, specifically in connection with computational effects, but Lawvere theories have not. So we define the notion of (countable) Lawvere theory and give a precise statement of its relationship with the notion of monad on the category Set. We illustrate with examples arising from the study of computational effects, explaining how the notion of Lawvere theory keeps one closer to computational practice. We then describe constructions that one can make with Lawvere theories, notably sum, tensor, and distributive tensor, reflecting the ways in which the various computational effects are usually combined, thus giving denotational semantics for the combinations.
A Model of Cooperative Threads
"... We develop a model of concurrent imperative programming with threads. We focus on a small imperative language with cooperative threads which execute without interruption until they terminate or explicitly yield control. We define and study a tracebased denotational semantics for this language; this ..."
Abstract

Cited by 10 (2 self)
 Add to MetaCart
We develop a model of concurrent imperative programming with threads. We focus on a small imperative language with cooperative threads which execute without interruption until they terminate or explicitly yield control. We define and study a tracebased denotational semantics for this language; this semantics is fully abstract but mathematically elementary. We also give an equational theory for the computational effects that underlie the language, including thread spawning. We then analyze threads in terms of the free algebra monad for this theory. 1
An Action Semantics for ML Concurrency Primitives
 In FME'94, Proc. Formal Methods Europe: Symposium on Industrial Benefit of Formal Methods, Barcelona, volume 873 of LNCS
, 1994
"... This paper is about the recentlydeveloped framework of action semantics. ..."
Abstract

Cited by 8 (5 self)
 Add to MetaCart
This paper is about the recentlydeveloped framework of action semantics.
Building interpreters by transforming stratified monads
, 1994
"... This paper shows how to construct programming language interpreters from a set of mixandmatch parts. By composing a sequence of semantic modules, we form an abstract data type (ADT) of computations, which is then used to build an ADT of language constructs. We represent the ADT of computations by ..."
Abstract

Cited by 7 (0 self)
 Add to MetaCart
This paper shows how to construct programming language interpreters from a set of mixandmatch parts. By composing a sequence of semantic modules, we form an abstract data type (ADT) of computations, which is then used to build an ADT of language constructs. We represent the ADT of computations by a stratified monad and the modules by stratified monad transformers. These results extend previous work on monads and have applications to language extensibility, interpreter construction, and the study of semantic models.
Monads and Adjunctions for Global Exceptions
, 2006
"... In this paper, we look at two categorical accounts of computational effects (strong monad as a model of the monadic metalanguage, adjunction as a model of callbypushvalue with stacks), and we adapt them to incorporate global exceptions. In each case, we extend the calculus with a construct, due t ..."
Abstract

Cited by 6 (1 self)
 Add to MetaCart
In this paper, we look at two categorical accounts of computational effects (strong monad as a model of the monadic metalanguage, adjunction as a model of callbypushvalue with stacks), and we adapt them to incorporate global exceptions. In each case, we extend the calculus with a construct, due to Benton and Kennedy, that fuses exception handling with sequencing. This immediately gives us an equational theory, simply by adapting the equations for sequencing. We study the categorical semantics of the two equational theories. In the case of the monadic metalanguage, we see that a monad supporting exceptions is a coalgebra for a certain comonad. We further show, using Beck’s theorem, that, on a category with equalizers, the monad constructor for exceptions gives all such monads. In the case of callbypushvalue (CBPV) with stacks, we generalize the notion of CBPV adjunction so that a stack awaiting a value can deal both with a value being returned, and with an exception being raised. We see how to obtain a model of exceptions from a CBPV adjunction, and vice versa by restricting to those stacks that are homomorphic with respect to exception raising.