| Moggi, E. Computational lambda-calculus and monads. Technical Report ECS-LFCS88 -66, Laboratory for Foundations of Computer Science, University of Edinburgh, 1988. |
....on the top) which leads to a further simplification of our correctness proof, at the expense of requiring a more powerful type system. Modular compilers. Inspired by the success of using monads to define the denotational semantics of languages in terms of the semantics of individual features [9], similar techniques are now being applied to build compilers in a modular manner [4] To date, however, this work has not considered the compilation of exceptions, so there is scope for trying to incorporate the present work into this modular framework. Calculating the compiler. Rather than ....
E. Moggi. An Abstract View of Programming Languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, 1990.
.... structure generalizing monoids, monads, Moggi is able to model amazingly many programming language features: side effects, exceptions, continuations, interactive input and output, and non determinism, to name a few [18] Monads can also be used for a modular approach to denotational semantics [17]. A monadic denotational semantics definition can be transliterated directly into a functional language. Wadler set out to do this with Haskell and came up with a new notation for comprehending monads and with an exemplary definitional interpreter structured with monads [27, 28] interpreters ....
....monad, the interpreter can be simplified into a familiar styled interpreter. A continuation monad yields a continuation passing style interpreter; a state monad yields a state passing style interpreter; and so on. These instantiations are documented in Moggi s and Wadler s published work [17, 28]. For lack of space, they are not reproduced here. Given a particuliar program, the interpreter can be simplified into the monadic form of this program. 2 (boot kleisli state monad) pure Scheme get set Kleisli interpreter join mode state (add1 (get) 1 . 0) state (set 3) ....
Eugenio Moggi. An abstract view of programming languages. Course notes, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh, Edinburgh, Scotland, May 1989.
....paper combines these methods with a method, based on catamorphisms, for dealing with syntax. Subtypes, monad transformers and catamorphisms make it possible to write library code which can be used for building functional interpreters which are composed of reusable components. 1 Introduction In [11] Moggi proposes to model the semantics of a program as a computation. In [12] Wadler shows how to write programming language interpreters as functions interpret : syntax compute value . The type syntax represents the syntax of the interpreted programming language. The unary type ....
....SubType class to handle constraints upon the value type in a modular way. Similarly, they make use of a MonadTransformer class to handle constraints upon the computation in a modular way. Monad transformers generalise the monad composition methods which the authors of [3] and [10] make use of. In [11] Moggi already suggested to make use of monad transformers to deal with the problem of modular monadic semantics. The interpreter in [8] is not composed of reusable components. It uses one monolithic data definition for representing the syntax of the interpreted language with. The main ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90113, Laboratory for Foundations of Computer Science, University of Edinburgh, Scotland, 1990.
....is known to us. In the present paper we summarize the results of our research [28] aiming at the development of a complete and accurate formal description for the semantics of ANSI C. For this purpose, we have chosen the denotational approach [35,26] and employ monads and monad transformers [23,38,20] in order to improve the modularity and elegance of the developed semantics. Our formalization is based on the 1990 version of the standard and all references to paragraphs and pages are with respect to that version [14] The rest of the paper is structured as follows. In Section 2 we identify a ....
....are deterministic, whether they require access to the program state, or whether they can cause run time errors. This is the principal concept behind the use of monads in denotational semantics. For a proper introduction to monads and their relation with computations, the reader is referred to [23,38]. The following brief description, although nave, is sufficient for the purpose of this paper. A monad is a triple #M, unit M , # M #, where: M is a domain constructor, unit M : A # M(A) is a polymorphic function for inserting values in computations, and . # M : M(A) A # ....
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS90 -113, University of Edinburgh, Laboratory for Foundations of Computer Science, 1990.
....denotational semantics is its lack of modularity: small changes in a language s de nition often imply a complete rewrite of its formal semantics. The use of monads has been proposed as a remedy and has become quite popular both in the denotational semantics and the functional programming community [20, 33]. Monads, which are directly supported in Haskell, are used in this paper in order to facilitate the de nition of a modular and elegant semantics for the three languages under study in a uni ed way. A brief description of the three languages is given below, together with our comments concerning ....
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, University of Edinburgh, Laboratory for Foundations of Computer Science, 1990.
....Extension: New Player 66 at Spellbound.dispatch(interp.java:26) at Main2.main(interp.java:105) The problem underlying both programs is in the interfaces that describe the kinds of information employed by the compiler of each language. This information is fundamentally denotational, or monadic [42, 58], in nature, corresponding to the semantics of the source and target languages of compilation. The problems associated with composing monads [30] apply equally to vocabulary compositions due to their monadic nature. 5.4 Discussion Studying the composable fragments of languages in light of the ....
Moggi, E. An abstract view of programming languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....both recursion and effects into the world of monads, this work reduces the problem of understanding the combination of recursion and computational effects to the problem of combining monads. The latter problem is rather well understood mathematically and has already been studied extensively [10, 14, 22, 23, 30]. Outline The next section reviews the use of monads in Haskell and motivates the need for mfix. Section 3 investigates the unfolding definition mfixU, and provides an example of its use. In Section 4, the updating definition of recursion in Scheme is analyzed. Section 5 mirrors the Scheme ....
Moggi, E. An abstract view of programming languages. Tech. Rep. ECSLFCS -90-113, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh, Edinburgh, EH9 3JZ, 1990.
.... ( and mapping a monad to a new transformed monad that includes some extra features: type MaybeT = FComp Maybe type ErrorT = FComp Error type WriterT = FComp Writer type ReaderT r = BComp (r ) The possibility of using monad transformers had previously been suggested by Moggi [22], leading independently to the use of pseudomonads in Steele s work on the construction of modular interpreters [25] and to a Scheme implementation by Espinosa [4, 5] The problem of implementing monad transformers in a strongly typed language has been addressed by Liang, Hudak and Jones [15] ....
E. Moggi. An abstract view of programming languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....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 automate these ideas in Semantic Lego (SL) a ....
....40 Chapter 2 Monads In this chapter, we first present some basic category theory, then discuss monads, maps between monads, monad composition, and monad transformation. This may sound like everything you always wanted to know about monads , but in reality it barely scratches the surface. See [BW85, Mog89a] for more information. Monads may be a hot topic in the 1990 s functional programming community, but the real monad explosion occurred in the category theory algebraic topology community during the 1960 s, when they were first invented. Although I consider myself a fairly good monad ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, June 1989. FTP from theory.doc.ic.ac.uk.
....ffl partial evaluation [9] Partial evaluation and pass separation have long been used in semantics directed compilation, but the use of monadic semantics and monad transformers is new in this setting. Monads and monad transformers have been used in the past to structure denotational definitions [16, 6, 27, 18] where they allow a mix and match (what Espinosa calls a semantic lego ) approach. It is argued here that similar benefits can be obtained for compilers. This method of compiler generation can be summarized as: 1. Start with a monad structured semantics. More precisely, the semantics is based ....
....of this kernel monad. I propose to fulfill my doctoral research by proving the correctness 2 of the compilers developed here following the outline discussed in Section 7. 2 Related Work Structuring denotational semantics with monads and monad transformers was originally proposed by Moggi [18]. Hudak, Liang, and Jones [16] Espinosa [6] and Wadler [27] use monads and monad transformers to create modular, extensible interpreters. This work shows how interpreters can be developed in a modular way, leaving open the question of whether compilers can be developed similarly. Liang [15, 17] ....
E. Moggi. An Abstract View of Programming Languages. Technical Report ECS-LFCS-90113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....identifier in the same scope, as well as associating identifiers with appropriate types or values. For each 1 Introductions to denotational semantics, including useful bibliography, can be found in [9] and [10] 2 Introductions to monads and their use in denotational semantics can be found in [11] and [12] 2 Figure 1: An abstract interpreter for C. Lexical Analysis Concrete Syntax Abstract Syntax Static Semantics Typing Semantics Dynamic Semantics C Program Meaning Tokens Parse Tree Abstract Parse Tree Type Environment Typing Derivation Semantic Analysis Syntactic ....
E. Moggi. An abstract view of programming languages. Technical Report ECSLFCS -90-113, University of Edinburgh, Laboratory for Foundations of Computer Science, 1990.
....It would be inconvenient to write parsers if we had to explicitly manage values of the Producer types. Monads provide just the right additional structure for manipulating these values, so that programs have a consistent style, and so that the details of the Producer types are abstracted away [10, 11, 15]. To make this claim more concrete, let us construct a little program in Scheme [8] for parsing natural numbers (non negative integers) We begin with a version written without the benefit of monadic operators. See Appendix A for details on how we represent values of arrow, product, and sum types ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, April 1989.
....style and theoretical detail, but it is unclear whether they ultimately lead to substantially different semantic properties. Although originally intended to capture stack like structure of the store, possibleworld semantics were later adapted to languages with dynamically allocated variables [28, 42, 63], and to languages with both local and dynamic variables [15] 6. Parametricity The interactions between procedures and local or dynamically allocated variables in imperative languages raise some additional important issues not adequately explained by possible world parameterization alone. One ....
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90113, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh, 1990.
....arrows between simple types. If all sequences are in nite, is a product. It handles all the bundling and unbundling of signals. The arr function corresponds to Hawk s lift functions. 2 Arrow morphisms and constructors Just as new monads are built from existing ones with monad constructors [5], Hughes [2] proposes to build arrow types with arrow functors, which provide a way of making a new arrow type, as well as a function to lift computations from the old arrow type to the new. The following multi parameter type class approximates this: class (Arrow a, Arrow (f a) ArrowFunctor f ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, 1990. 8
....programming as a kind of meta computation protocol, which makes it a much more plausible framework for reflecting about computational properties. 2. 3 Monads Monads are category theoretic constructs that first received the attention of the programming language community when Moggi [13, 14] used them to represent effect laden computation in denotational semantics. Since then, they have seen growing acceptance as a practical tool, especially as a means of handling I O and other side effects in purely functional languages. Each monad is defined as a triple consisting of a type ....
....as a compound computation, the subexpression that evaluates as the initial subcomputation should be clearly set apart. Given these requirements, it is not surprising that the resulting translation bears a strong resemblance to continuation passing style [15] A normal form [6] and monadic style [13, 19]. See section 5. The translation R given below places references to two functions in its output: ff is applied to the program fragments that correspond to atomic computations, and fl is applied to the program fragments that correspond to compound computations. The first argument to fl ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, April 1989.
....all future extensions. Using this style, programmers can also experiment with interesting language extensions, such as the lexical macros described in section 3.3. Validation Information is communicated through the attributes; the threaded attributes are fundamentally denotational, or monadic [31, 35], in nature. The problems associated with composing vocabularies are thus the same as those with composing arbitrary programming languages. There are some efforts to design sound type systems for mixins [15] but these are still preliminary. There are unfortunately few type systems that type ....
Moggi, E. An abstract view of programming languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....it has long been recognized that traditional denotational semantics [31] is not suitable for compiler generation for a number of crucial reasons [17] among which is the lack of modularity and extensibility. We take advantage of a newdevelopment in programming language theory, amonadic approach [21] to structured denotational semantics, that achieves a high level of modularity and extensibility. The source language we consider in this paper has a variety of features, including both call by name and call by value versions of functions: e : n j e 1 e 2 (arithmetic operations) j v j v:e j ....
....the novelty of our approach lies in how the kernel level primitive operations are organized. In our framework, depending onhowmuch support the upper layers need, any set of primitive operations can be put together in a modular way using an abstraction mechanism called monad transformers [21] [18] Monad transformers provide the power needed to represent the abstract notion of programming language features, but still allow us to access low level semantic details. In fact, since monad transformers are defined as higher order functions, our monadic semantics is no more than a structured ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....applications to language extensibility, the construction of interpreters and compilers, and the study of semantic models. 1 Introduction Our goal is to construct implementations for a wide variety of programming languages from a small set of reusable parts. Beginning from Eugenio Moggi s work [Mog89a], we present languages as abstract data types and incrementally construct ADT implementations from semantic modules. We work in the area of computational semantics in that we demonstrate Semantic Lego, a prototype implementation in Scheme, rather than construct domain theoretic models. To ....
....TCC. Monads are required because procedural abstraction over language features implies nested use of T. 4 Previous Work This section relates Semantic Lego to previous work and addresses the question of why it took so long for the rest of us to realize what Moggi knew all along. 4. 1 Moggi In [Mog89a, Mog89b, Mog91b], Eugenio Moggi realized that monads could be used to structure denotational models. He showed that lambda calculus could be parametrized by an arbitrary monad to yield widely varying semantics. His course notes [Mog89a] written while he was visiting Stanford, also present much additional ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, June 1989. FTP from theory.doc.ic.ac.uk : theory/papers/Moggi.
....[DJL88] and abstract semantic algebras [Mos92] were developed to solve this problem but cannot handle complex semantics. Using the toolkit, we simply add the stores module to the language specification. To achieve these results, we reformulate Moggi s theory of modular denotational semantics [Mog89a, Mog91a]. We introduce stratified monads, sets of named semantic levels, related in pairs by monads. We define language constructs using the monad operators conceptually relevant to them, independent of other details of the semantics. We realize semantic modules, such as stores and continuations, as ....
....to them, independent of other details of the semantics. We realize semantic modules, such as stores and continuations, as stratified monad transformers. This paper is a significant advance over previous work that uses monads as a basis for modular language specification. Specifically, ffl Moggi [Mog89a] presents a complex formalism that is often difficult to understand. We introduce a simpler and more flexible theory. By representing it in computational terms, we render it both more useful and more accessible. ffl Wadler [Wad92] builds interpreters from two parts, a base and an extension. Our ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, June 1989. FTP from theory. doc.ic.ac.uk.
.... languages [Mog89] and as a structuring technique for purely functional programs with computational e ects [Wad92] But the situation is less clear for the prospect of using monads to structure multiple, potentially intertwined e ects: although a number of frameworks for this have been proposed [Mog90, Ste94, CF94, LHJ95, Esp95] none seem to have gained overwhelming acceptance. This is perhaps not surprising, since a truly modular characterization of computational e ects is probably an ill Basic Research in Computer Science (http: www.brics.dk) Centre of the Danish National Research ....
....T is layered over T by , and T over T by , then T is also layered over T by A TA T TA : T (TA) TA. When T is layered over T , we can also de ne a computation inclusion or lifting [LHJ95, Tol98] function family i A = A T A : TA TA. This is easily checked to be a monad morphism [Mog90] i.e. to satisfy the equations i A ( A a) A a and i B (t 0 f) i A t 0 ( a: i B (f a) Conversely, given a monad morphism i : T T , we can obtain a layering by A = id TA i A . Both formulations allow us to de ne a mixed binding operation A;B : TA (A TB) TB ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, April 1990.
....and explicit representations of control and the relation between implicit and explicit representations of state, in a typed setting. In particular, we are currently investigating how the continuation state monad (obtained e.g. by applying the statemonad constructor to the continuation monad [25]) offers a generic relation between implicit and explicit representations of both control and state. We are also considering to add computational effects on control (first class continuations) and on the state (side effects) 10 Conclusion and Issues We have characterized CPS transformations of ....
Eugenio Moggi. An abstract view of programming languages. Course notes ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh, Edinburgh, Scotland, April 1990.
....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 automate these ideas in Semantic Lego (SL) a ....
....Chapter 2 Monads In this chapter, we first present some basic category theory, then discuss monads, maps between monads, monad composition, and monad transformation. This may sound like everything you always wanted to know about monads , but in reality it barely scratches the surface. See [BW85, Mog89a] for more information. Monads may be a hot topic in the 1990 s functional programming community, but the real monad explosion occurred in the category theory algebraic topology community during the 1960 s, when they were first invented. Although I consider myself a fairly good monad hacker ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, June 1989. FTP from theory.doc.ic.ac.uk. 96
....also serve as objects for some other, higherlevel, morphisms. This leads to 2 categories, of which the category Cat of categories is the canonical example, with natural transformations as morphisms of its morphisms. This concept was mentioned in Example 2. 7, and is also used in [24] 26] 40] [56], among other places, and is mentioned in [61] 8.2 Monoidal Categories. There are many cases where a category has a natural notion of multiplication that is not the usual Cartesian product but nevertheless enjoys many of the same properties. The category of Petri nets studied in [52] has already ....
....A strict indexed category is just a functor B op Cat. The papers [62] and [23] give many examples of indexed categories in computing science, and [62] gives some general theorems, including simple sufficient conditions for completeness of the associated Grothendieck category. Moggi [56] applies indexed categories to programming languages, and in particular shows how to get a kind of higher order module facility for languages like ML. Non strict indexed categories are significantly more complex, and have been used in foundational studies [57] 8.5 Topoi. A profound ....
Eugenio Moggi. A category-theoretic account of program modules, 1989. Laboratory for Foundations of Computer Science, University of Edinburgh.
....generates a generalised Lawvere theory, and then shows that many different problems of unification (that is, of solving systems of equations) can be naturally formulated as finding equalisers in Kleisli categories. Examples include unification in order sorted and continuous theories. Moggi [55] uses Kleisli categories to get an abstract notion of computation which gives rise to many interesting generalisations of the calculus. 6 Colimits The sixth dogma says: Given a species of structure, say widgets, then the result of interconnecting a system of widgets to form a super widget ....
Eugenio Moggi. Computational lambda-calculus and monads. Technical Report ECS-LFCS-88-66, Laboratory for Foundations of Computer Science, University of Edinburgh, 1988.
.... Surprisingly, incorporating imperative features into a purely functional language has become an active area of research within the functional programming community [30, 24, 36, 20] One of the techniques gaining widespread acceptance as a model for imperative functional programming is monads [38, 37, 26]. Typically monads are used to guarantee single threadedness, enabling side effects to be incorporated into a purely functional language without losing referential transparency. We take a different approach. First for loops are translated into a monadic framework. Next, by ensuring that the monad ....
....programs expressed using the model can be trivially vectorised. Before introducing the model, some basic category theory, and a category theoretic description of monads is given. This description stems from the desire for a understanding of Moggi s work on computational calculus and Monads [26, 25], and owes much to the collection of category theory books [31, 2, 9, 23, 3] 9 Basic category theory and monads Category theory is concerned with the observation that many of the properties from algebra can be simplified by a presentation in terms of diagrams containing arrows it s just ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS90 -113, Laboratory for Foundations of Computer Science, University of Edinburgh, April 1990.
.... communicative facets essential to most real programming languages [Mos96a, x6.4] 3 Modular monadic semantics Modular monadic semantics (MMS) LHJ95, LH96] is a structured form of denotational semantics developed recently by Liang, Hudak, and Jones of Yale University based on the work of Moggi [Mog89a, Mog91a] and Espinosa [Esp93, Esp94] It provides a very usable approach to denotational semantics with excellent flexibility and modularity properties. MMS is presented in the syntax of an existing functional language, thus permitting specifications to be directly executed. In the following sections we ....
....continuation facet of MMAS and for all facets of base MMAS is given in Wansbrough s thesis [Wan97] 6 Related work The work described here owes a great debt to the work of Mosses and others [Mos92, Mos96a] on action semantics. Modular monadic semantics derives ultimately from the work of Moggi [Mog89a, Mog89b, Mog91b, Mog91a] on monads for programming language semantics. Steele s work [Ste94] on pseudomonads provided an early prototype of a system very similar to MMAS. Espinosa [Esp95] and Liang, Hudak, and Jones [LHJ95, LH96] provided the details of the implementation of Moggi s ideas in a working system; MMAS is ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, June 1989. Available http://theory.doc.ic.ac. uk:80/tfm/papers/MoggiE/absview. ps.gz.
....it has long been recognized that traditional denotational semantics [24] is not suitable for compiler generation for a number of crucial reasons [16] among which is the lack of modularity and extensibility. We take advantage of a new development in programming language theory, a monadic approach [19] to structured denotational semantics, that achieves a high level of modularity and extensibility. The source language we consider in this paper has a variety of features, including both call by name and call byvalue versions of functions: e : n j e 1 e 2 (arithmetic operations) j v j v:e j ....
....the novelty of our approach lies in how the kernellevel primitive operations are organized. In our framework, depending on how much support the upper layers need, any set of primitive operations can be put together in a modular way using an abstraction mechanism called monad transformers [19] [17] Monad transformers provide the power needed to represent the abstract notion of programming language features, but still allow us to access low level semantic details. In fact, since monad transformers are defined as higher order functions, our monadic semantics is no more than a structured ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....x not free in M (j v ) x: V x) V; if x not free in V However it is not clear how one might formulate j rules in Lin in a way which admits useful results about the translations. Sabry and Wadler [33] identify a variant of Lin including j rules into which Moggi s computation lambda calculus [28,29] (see the next section below) can be translated by a map which is in fact a reflection. However, Sabry and Wadler s target linear calculus does not allow ( Gammaffi) steps, restricts the form of fi redexes, and uses an awkward (j Gammaffi) rule (j Gammaffi) x: let y = x in V y V y 6 2 fv(V ....
....lambda calculus It is reasonable to ask whether more laws could be added to Val, Let or Need so that the corresponding steadfast translations would be complete for either reduction or equality. A hint as to a suitable extension is provided by Moggi s computational lambda calculus Comp [28,29], shown in Figure 13. The version of the calculus shown here is based on the untyped reduction calculus, which Moggi calls c , and which appears in his technical report [28] but not his LICS paper [29] The terms of this theory are the same as for Let; though the grammar now distinguishes ....
[Article contains additional citation context not shown here]
E. Moggi, Computational lambda-calculus and monads (Technical Report ECS-LFCS88 -66, Laboratory for the Foundations of Computer Science, University of Edinburgh, October 1988).
....x = M in x M (comp) let y = let x = L in M) in N let x = L in (let y = M in N) let:1) E M let z = E in z M (let:2) V E let x = E in V x Figure 10: Moggi s computational lambda calculus comp. The second of these is similar to the right unit law in Moggi s computation lambda calculus [Mog88, Mog89]. Just as a (fi) rule simplifies a logical introduction followed by the corresponding logical elimination, so each of these (j) rules simplifies a logical elimination followed by the corresponding logical introduction. One would expect that the translation from name to lin should preserve the (j) ....
....x = M in xN) y lin = M N) y , but not (let x = M in xN) let = M N ) It is reasonable to ask if more laws could be added to let to yield a theory (LET ) for which M let 0 = N if and only if M lin = N . A candidate for such a theory is Moggi s computational lambda calculus comp [Mog88, Mog89], as shown in Figure 10. The version shown here is based on the untyped reduction calculus, which appears in the technical report [Mog88] but not the LICS paper [Mog89] The grammar of this theory is the same as for let, except that both values and non values are distinguished. This system ....
[Article contains additional citation context not shown here]
E. Moggi, Computational lambda-calculus and monads. Technical Report ECS-LFCS-8866, Laboratory for the Foundations of Computer Science, University of Edinburgh, October 1988.
....that mirrors the subtleties of reference behaviour in Standard ML. Pitts and Stark describe the nu calculus in [PS93b, PS93a] and outline a categorical semantics for the language. This model uses a computational monad, following Moggi s general scheme for extensible denotational semantics [Mog90, Mog91] The idea is to use a cartesian closed category C for the functional part of the model, and concentrate all non standard behaviour in a chosen monad T : C C. Loosely, for every object of values A, there is an object of computations TA; and Moggi s observation is that the requirement ....
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, April 1990.
.... of London Abstract Incorporating imperative features into a purely functional language has become an active area of research within the functional programming community [10, 7, 12] One of the techniques gaining widespread acceptance as a model for imperative functional programming is monads [13, 9]. The purpose of this technical report is to give a category theoretic introduction to monads, and to explore the relationship to what functional programmers term a monad. Keywords: Monads; Category theory; Kleisli triple; Imperative functional programming. 1 Motivation This paper stems from the ....
....monads, and to explore the relationship to what functional programmers term a monad. Keywords: Monads; Category theory; Kleisli triple; Imperative functional programming. 1 Motivation This paper stems from the desire for an understanding of Moggi s work on the computational calculus and Monads [9, 8]. The presentation here owes much to the papers of Wadler [13, 14] and the basic texts on category theory [11, 1, 4, 6, 2] 2 Basic category theory and monads Category theory is concerned with the observation that many of the properties from algebra can be simplified by a presentation in terms ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS90 -113, Laboratory for Foundations of Computer Science, University of Edinburgh, April 1990.
....compile time. Also, the efficient code generation algorithm relies on the DML specification using a small number of primitive operations, which can be mapped directly to quadruples. 3.3. 4 Modular Denotational Semantics Recently, work in functional programming has concentrated on the use of monads[Mog90,Wad90] to provide additional structure to the normal l calculus and allow the development of models for functional I O and hidden state. Liang and Hudak[LH96] have adapted this work on monads to structure the denotational semantics of programming languages. In their work, Liang and Hudak use a number of ....
E. Moggi. An abstract view of programming languages. ECS-LFCS-90-113, Laboratory for the Foundations of Computer Science, Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990. Bibliography 192
.... Surprisingly, incorporating imperative features into a purely functional language has become an active area of research within the functional programming community [30, 24, 36, 20] One of the techniques gaining widespread acceptance as a model for imperative functional programming is monads [38, 37, 26]. Typically monads are used to guarantee single threadedness, enabling side effects to be incorporated into a purely functional language without losing referential transparency. We take a different approach. First for loops are translated into a monadic framework. Next, by ensuring that the monad ....
....programs expressed using the model can be trivially vectorised. Before introducing the model, some basic category theory, and a category theoretic description of monads is given. This description stems from the desire for a understanding of Moggi s work on computational calculus and Monads [26, 25], and owes much to the collection of category theory books [31, 2, 9, 23, 3] 9 Basic category theory and monads Category theory is concerned with the observation that many of the properties from algebra can be simplified by a presentation in terms of diagrams containing arrows A category C ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS90 -113, Laboratory for Foundations of Computer Science, University of Edinburgh, April 1990.
....such as Mosses action semantics [16] and related efforts by Lee [13] Wand [23] Appel Jim [1] Kelsey Hudak [11] and others, attempt to solve parts of this problem, but fall short in several crucial ways. 1 A ground breaking attempt to better solve the overall problem began with Moggi s [15] proposal to use monads to structure denotational semantics. Wadler [21] popularized Moggi s ideas in the functional programming community by showing that many type constructors (such as List) were monads and how monads could be used in a variety of settings, many with an imperative feel (such ....
....parts, but he failed to properly incorporate important features such as an environment and store, and struggled with restrictions in the Haskell [7] type system when trying to implement his ideas. In fact, pseudomonads are really just a special kind of monad transformer, first suggested by Moggi [15] as a potential way to leave a hole in a monad for further extension. Returning to Moggi s original ideas, Espinosa [4] nicely formulated in Scheme a system called Semantic Lego the first modular interpreter based on monad transformers and laid out the issues in lifting. Espinosa s work ....
[Article contains additional citation context not shown here]
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....in N) j let x = M in N Fig. 4. The call by let calculus. To restore completeness in the latter case we add more laws to val, yielding a system we call let. The new laws are similar to the commuting conversions of lin, and also have some similarity to Moggi s computational lambda calculus [21,22], as discussed in Section 8.3. Figure 4 defines the call by let lambda calculus let and presents its translation into the linear lambda calculus. The terms are the same as previously, plus a let contruct, and the values remain unchanged. The types and type rules are also the same, with the ....
....V; if x not free in V Maraist et al. Similarly, one might add (j Gammaffi) and (j ) rules to the linear lambda calculus. j Gammaffi) x: M x) M; if x not free in M (j ) let x = M in x M The second of these is similar to the right unit law (id) in Moggi s computation lambda calculus [21,22] (see the next section below) Just as a (fi) rule simplifies a logical introduction followed by the corresponding logical elimination, so each of these (j) rules simplifies a logical elimination followed by the corresponding logical introduction. One would expect that the translation ffi from ....
[Article contains additional citation context not shown here]
E. Moggi, Computational lambda-calculus and monads. Technical report ECS-LFCS-88-66, Laboratory for the Foundations of Computer Science, University of Edinburgh, October 1988.
....Briefly, the complication is that a monad by itself is a closed package that contains too little information: we need instead to express the monadic data as an increment to be layered on top of other possible effects. How to do this uniformly is still not quite clear; Moggi s monad constructors [15] and Steele s pseudomonads [29] are two possible techniques. In the composable continuations characterization of monads, monad combination seems to correspond to also letting the target language of the defining translations contain monadic effects, leading to the hierarchy of control operators ....
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, April 1990.
....n:n because the left hand side reduces to true while the left hand side reduces to false. The semantical analysis of the nu calculus is made in two steps. First, a computational metalanguage based on the computational lambda calculus of Moggi [Mog89, CHAPTER 3. POINTERS AND DYNAMIC VARIABLES 29 Mog90] is provided, and the nu calculus is given an interpretation in it. This model forms the foundation on which several categorical models are created indirectly by giving different categorical models for the computational metalanguage. The types of the metalanguage are similar to the ones of the ....
.... in [ M ] F M ] let f ( F ] in let m ( M ] in fm [ fn 1 ; n k g; x 1 7 oe 1 ; x l 7 oe l ) n 1 2 Names; n k 2 Names; x 1 2 [ oe 1 ] x l 2 [ oe l ] The categorical requirements for modeling the metalanguage have been determined by Moggi [Mog89, Mog90, Mog91] as a Cartesian closed category with a strong monad. Cartesian closed categories are the usual modeling environment for the simply typed lambda calculus and the strong monad encapsulates the notion of computation. A strong monad T is described as an endofunctor with a natural ....
[Article contains additional citation context not shown here]
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh, 1990.
No context found.
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, University of Edinburgh, Laboratory for Foundations of Computer Science, 1990.
....the way that we interpret the symbol. More precisely, in assigning types to instructions, we just need to reinterpret function types like a b as types of the form a m b. The symbol m used here represents a monad that encapsulates the specific computational features that we are interested in [13, 25]. To explore this idea in detail would take us beyond the scope of the current paper, so this section aims only to explain the basic concepts. For the purposes of this paper, it is enough to think of a monad as a particular kind of parameterized datatype with the intuition that, if m is a monad, ....
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
....lambda calculus to languages with control and assignment abstractions. These calculi are simplified and extended by Felleisen and Hieb in [9] Talcott, Mason, and Felleisen all apply their theories to expressing and proving properties of program constructs and of particular programs. Moggi [27, 28] introduces the notion of computational monad as a framework for axiomatizing features of programming languages. Computational monads are categories with certain additional structure that accommodate a wide variety of language features including assignment, exceptions, and control abstractions. An ....
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS90 -113, Laboratory for Foundations of Computer Science, University of Edinburgh, 1990.
No context found.
Moggi, E. Computational lambda-calculus and monads. Technical Report ECS-LFCS88 -66, Laboratory for Foundations of Computer Science, University of Edinburgh, 1988.
No context found.
E. Moggi, Computational lambda-calculus and monads. Technical report ECS-LFCS-88-66, Laboratory for the Foundations of Computer Science, University of Edinburgh, October 1988.
No context found.
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, April 1990.
No context found.
Eugenio Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, April 1990.
No context found.
E. Moggi. An abstract view of programming languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, April 1990. (pp. 8, 37, 57, 119)
No context found.
E. Moggi. An Abstract View of Programming Languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, 1990.
No context found.
Eugenio Moggi. An abstract view of programming languages. LFCS Report ECS--LFCS--90--113, Laboratory for Foundations of Computer Science, Department of Computer Science, University of Edinburgh, April 1990.
No context found.
E. Moggi. An Abstract View of Programming Languages. Technical Report ECSLFCS -90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC