Results 1 
8 of
8
Understanding and Evolving the ML Module System
, 2005
"... 0121633. Any opinions, findings, and conclusions or recommendations in this publication are those of the author and do not reflect the views of these agencies. Keywords: ML, module systems, type systems, functors, abstract data types, lambda calculus, The ML module system stands as a highwater mark ..."
Abstract

Cited by 43 (14 self)
 Add to MetaCart
0121633. Any opinions, findings, and conclusions or recommendations in this publication are those of the author and do not reflect the views of these agencies. Keywords: ML, module systems, type systems, functors, abstract data types, lambda calculus, The ML module system stands as a highwater mark of programming language support for data abstraction. Nevertheless, it is not in a fully evolved state. One prominent weakness is that module interdependencies in ML are restricted to be acyclic, which means that mutually recursive functions and data types must be written in the same module even if they belong conceptually in different modules. Existing efforts to remedy this limitation either involve drastic changes to the notion of what a module is, or fail to allow mutually recursive modules to hide type information from one another. Another issue is that there are several dialects of ML (the most popular being SML and O’Caml), and the module systems of these dialects differ in subtle yet semantically significant ways that have been difficult to account for in any rigorous way. It is important to come to a clear assessment of the existing design space and consolidate what is meant by “the ML module system” before embarking on such a major extension as recursive modules. In this dissertation I contribute to the understanding and evolution of the ML module system
Mixin Modules and Computational Effects
, 2003
"... We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS with a monadic metalanguage supporting the two separate notions of simplification (local rewrite rules) and computation (global evaluation ab ..."
Abstract

Cited by 18 (6 self)
 Add to MetaCart
We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS with a monadic metalanguage supporting the two separate notions of simplification (local rewrite rules) and computation (global evaluation able to modify the store). This distinction is important for smoothly integrating the CMS rules (which are all local) with the rules dealing with the imperative features. In our calculus mixins...
Arrows, like monads, are monoids
 Proc. of 22nd Ann. Conf. on Mathematical Foundations of Programming Semantics, MFPS XXII, v. 158 of Electron. Notes in Theoret. Comput. Sci
, 2006
"... Monads are by now wellestablished as programming construct in functional languages. Recently, the notion of “Arrow ” was introduced by Hughes as an extension, not with one, but with two type parameters. At first, these Arrows may look somewhat arbitrary. Here we show that they are categorically fai ..."
Abstract

Cited by 12 (1 self)
 Add to MetaCart
Monads are by now wellestablished as programming construct in functional languages. Recently, the notion of “Arrow ” was introduced by Hughes as an extension, not with one, but with two type parameters. At first, these Arrows may look somewhat arbitrary. Here we show that they are categorically fairly civilised, by showing that they correspond to monoids in suitable subcategories of bifunctors C op ×C → C. This shows that, at a suitable level of abstraction, arrows are like monads — which are monoids in categories of functors C → C. Freyd categories have been introduced by Power and Robinson to model computational effects, well before Hughes ’ Arrows appeared. It is often claimed (informally) that Arrows are simply Freyd categories. We shall make this claim precise by showing how monoids in categories of bifunctors exactly correspond to Freyd categories.
Value Recursion in Monadic Computations
 OGI School of Science and Engineering, OHSU
, 2002
"... viii 1 ..."
An Alternative Approach to Initializing Mutually Referential Objects
, 2005
"... Mutual dependencies between objects arise frequently in programs, and programmers must typically resort to manually filling “initialization holes ” to help construct the corresponding object graphs, i.e. null values and/or explicitly mutable locations. This report describes a “baseline ” proposal f ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Mutual dependencies between objects arise frequently in programs, and programmers must typically resort to manually filling “initialization holes ” to help construct the corresponding object graphs, i.e. null values and/or explicitly mutable locations. This report describes a “baseline ” proposal for a generalized form of value recursion in an MLlike language called initialization graphs, where value recursion is given the simplistic semantics of a graph of lazy computations whose nodes are sequentially forced, with uses of recursive values checked for initializationsoundness at runtime. We then develop examples using this mechanism to show how problematic the issue of value recursion is for MLlike languages, and in particular how sophisticated reactive objects cannot be defined in the language without using initialization holes, and how this forces ML programmers to break abstraction boundaries. At the same time we show how OO languages rely extensively on null pointers during initialization. We propose that a general, semisafe mechanism allows value recursion to be used in conjunction with existing sophisicated abstract APIs such GUI libraries, and allows freshly defined APIs to be both abstract and yet not require clients to use explicit initialization holes. We propose that the initialization mechanism permits more programs to be expressed in the mutationfree fragment of ML, though we do not formally prove this result. 1
Efficient Recursion in the Presence of Effects
"... In the interest of designing a recursive module extension to ML that is as simple and general as possible, we study the important subproblem of how to support recursive definitions of effectful expressions. Effects seem to necessitate a Schemestyle backpatching semantics of recursion, which typical ..."
Abstract
 Add to MetaCart
In the interest of designing a recursive module extension to ML that is as simple and general as possible, we study the important subproblem of how to support recursive definitions of effectful expressions. Effects seem to necessitate a Schemestyle backpatching semantics of recursion, which typically results in a performance penalty since all recursive references must check whether or not the recursive variable has been backpatched yet.
Mixin Modules and Computational Effects
"... Abstract. We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS with a monadic metalanguage supporting the two separate notions of simplification (local rewrite rules) and computation (global eva ..."
Abstract
 Add to MetaCart
Abstract. We define a calculus for investigating the interactions between mixin modules and computational effects, by combining the purely functional mixin calculus CMS with a monadic metalanguage supporting the two separate notions of simplification (local rewrite rules) and computation (global evaluation able to modify the store). This distinction is important for smoothly integrating the CMS rules (which are all local) with the rules dealing with the imperative features. In our calculus mixins can contain mutually recursive computational components which are explicitly computed by means of a new mixin operator whose semantics is defined in terms of a Haskelllike recursive monadic binding. Since we mainly focus on the operational aspects, we adopt a simple type system like that for Haskell, that does not detect dynamic errors related to bad recursive declarations involving effects. The calculus serves as a formal basis for defining the semantics of imperative programming languages supporting first class mixins while preserving the CMS equational reasoning. 1
Fixing Idioms A recursion primitive for applicative DSLs
"... In a lazy functional language, the standard encoding of recursion in DSLs uses the host language’s recursion, so that DSL algorithms automatically use the host language’s least fixpoints, even though many domains require algorithms to produce different fixpoints. In particular, this is the case for ..."
Abstract
 Add to MetaCart
In a lazy functional language, the standard encoding of recursion in DSLs uses the host language’s recursion, so that DSL algorithms automatically use the host language’s least fixpoints, even though many domains require algorithms to produce different fixpoints. In particular, this is the case for DSLs implemented as Applicative functors (structures with a notion of pure computations and function application). We propose a recursion primitive afix that models a recursive binder in a finally tagless HOAS encoding, but with a novel rank2 type that allows us to specify and exploit the effectsvalues separation that characterises Applicative DSLs. Unlike related approaches for Monads and Arrows, we model effectful recursion, not value recursion. Using generic programming techniques, we define an aritygeneric version of the operator to model mutually recursive definitions. We recover intuitive user syntax with a form of shallow syntactic sugar: an alet construct that syntactically resembles the let construct, which we have implemented in the GHC Haskell compiler. We describe a proposed axiom for the afix operator. We demonstrate usefulness with examples from Applicative parser combinators and functional reactive programming. We show how higherorder recursive operators like many can be encoded without special library support, unlike previous approaches, and we demonstrate an implementation of the left recursion removal transform.