Results 1 - 10
of
27
Comprehending Monads
- Mathematical Structures in Computer Science
, 1992
"... Category theorists invented monads in the 1960's to concisely express certain aspects of universal algebra. Functional programmers invented list comprehensions in the 1970's to concisely express certain programs involving lists. This paper shows how list comprehensions may be generalised to an arbit ..."
Abstract
-
Cited by 418 (11 self)
- Add to MetaCart
Category theorists invented monads in the 1960's to concisely express certain aspects of universal algebra. Functional programmers invented list comprehensions in the 1970's to concisely express certain programs involving lists. This paper shows how list comprehensions may be generalised to an arbitrary monad, and how the resulting programming feature can concisely express in a pure functional language some programs that manipulate state, handle exceptions, parse text, or invoke continuations. A new solution to the old problem of destructive array update is also presented. No knowledge of category theory is assumed.
How to Make Ad-Hoc Polymorphism Less Ad Hoc
, 1988
"... This paper presents type classes, a new approach to ad-hoc polymorphism. Type classes permit overloading of arithmetic operators such as multiplication, and generalise the "eqtype variables" of Standard ML. Type classes extend the Hindley/Milner polymorphic type system, and provide a new approach to ..."
Abstract
-
Cited by 315 (3 self)
- Add to MetaCart
This paper presents type classes, a new approach to ad-hoc polymorphism. Type classes permit overloading of arithmetic operators such as multiplication, and generalise the "eqtype variables" of Standard ML. Type classes extend the Hindley/Milner polymorphic type system, and provide a new approach to issues that arise in object-oriented programming, bounded type quantification, and abstract data types. This paper provides an informal introduction to type classes, and defines them formally by means of type inference rules. 1 Introduction Strachey chose the adjectives ad-hoc and parametric to distinguish two varieties of polymorphism [Str67]. Ad-hoc polymorphism occurs when a function is defined over several different types, acting in a different way for each type. A typical example is overloaded multiplication: the same symbol may be used to denote multiplication of integers (as in 3*3) and multiplication of floating point values (as in 3.14*3.14). Parametric polymorphism occurs wh...
Naturally Embedded Query Languages
- LNCS 646: Proceedings of 4th International Conference on Database Theory
, 1992
"... We investigate the properties of a simple programming language whose main computational engine is structural recursion on sets. We describe a progression of sublanguages in this paradigm that (1) have increasing expressive power, and (2) illustrate robust conceptual restrictions thus exhibiting inte ..."
Abstract
-
Cited by 118 (25 self)
- Add to MetaCart
We investigate the properties of a simple programming language whose main computational engine is structural recursion on sets. We describe a progression of sublanguages in this paradigm that (1) have increasing expressive power, and (2) illustrate robust conceptual restrictions thus exhibiting interesting additional properties. These properties suggest that we consider our sublanguages as candidates for "query languages". Viewing query languages as restrictions of our more general programming language has several advantages. First, there is no "impedance mismatch" problem; the query languages are already there, so they share common semantic foundation with the general language. Second, we suggest a uniform characterization of nested relational and complex-object algebras in terms of some surprisingly simple operators; and we can make comparisons of expressiveness in a general framework. Third, we exhibit differences in expressive power that are not always based on complexity arguments...
A Runtime System
, 1990
"... The runtime data structures of the Standard ML of New Jersey compiler are simple yet general. As a result, code generators are easy to implement, programs execute quickly, garbage collectors are easy to implement and work efficiently, and a variety of runtime facilities can be provided with ease. ..."
Abstract
-
Cited by 62 (3 self)
- Add to MetaCart
The runtime data structures of the Standard ML of New Jersey compiler are simple yet general. As a result, code generators are easy to implement, programs execute quickly, garbage collectors are easy to implement and work efficiently, and a variety of runtime facilities can be provided with ease.
Toward formal development of ML programs: foundations and methodology
, 1989
"... A formal methodology is presented for the systematic evolution of modular Standard ML programs from specifications by means of verified refinement steps, in the framework of the Extended ML specification language. Program development proceeds via a sequence of design (modular decomposition), codi ..."
Abstract
-
Cited by 50 (20 self)
- Add to MetaCart
A formal methodology is presented for the systematic evolution of modular Standard ML programs from specifications by means of verified refinement steps, in the framework of the Extended ML specification language. Program development proceeds via a sequence of design (modular decomposition), coding and refinement steps. For each of these three kinds of steps, conditions are given which ensure the correctness of the result. These conditions seem to be as weak as possible under the constraint of being expressible as "local" interface matching requirements. Interfaces are only required to match up to behavioural equivalence, which is seen as vital to the use of data abstraction in program development. Copyright c fl 1989 by D. Sannella and A. Tarlecki. All rights reserved. An extended abstract of this paper will appear in Proc. Colloq. on Current Issues in Programming Languages, Joint Conf. on Theory and Practice of Software Development (TAPSOFT), Barcelona, Springer LNCS (1989)....
On the Expressiveness of Purely Functional I/O Systems
, 1989
"... Functional programming languages have traditionally lacked complete, flexible, and yet referentially transparent I/O mechanisms. Previous proposals for I/O have used either the notion of lazy streams or continuations to model interaction with the external world. We discuss and generalize these mo ..."
Abstract
-
Cited by 22 (2 self)
- Add to MetaCart
Functional programming languages have traditionally lacked complete, flexible, and yet referentially transparent I/O mechanisms. Previous proposals for I/O have used either the notion of lazy streams or continuations to model interaction with the external world. We discuss and generalize these models and introduce a third, which we call the systems model, to perform I/O. The expressiveness of the styles are compared by means of an example. We then give a series of surprisingly simple translations between the three models, demonstrating that they are not as different as their programming styles suggest, and implying that the styles could be mixed within a single program. The need to express non-deterministic behavior in a functional language is well recognized. So is the problem of doing so without destroying referential transparency. We survey past approaches to this problem, and suggest a solution in the context of the I/O models described. The I/O system of the purely func...
Compiling Pattern Matching by Term Decomposition
, 1989
"... We present a method for compiling pattern matching on lazy languages based on previous work by Laville and Huet-Levy. It consists of coding ambiguous linear sets of patterns using "Term Decomposition," and producing non ambiguous sets over terms with structural constraints on variables. The method c ..."
Abstract
-
Cited by 21 (0 self)
- Add to MetaCart
We present a method for compiling pattern matching on lazy languages based on previous work by Laville and Huet-Levy. It consists of coding ambiguous linear sets of patterns using "Term Decomposition," and producing non ambiguous sets over terms with structural constraints on variables. The method can also be applied to strict languages giving a match algorithm that includes only unavoidable tests when such an algorithm exists.
Reasoning with the Formal Definition of Standard ML in HOL
- In Sixth International Workshop on Higher Order Logic Theorem Proving and its Applications
, 1993
"... This paper describes the results of a project to embed the Formal Definition of the Standard ML Core language into the HOL mechanized reasoning system. HOL theories of the Core syntax and dynamic semantics are presented, including a purely definitional representation of the semantic inference rules ..."
Abstract
-
Cited by 20 (0 self)
- Add to MetaCart
This paper describes the results of a project to embed the Formal Definition of the Standard ML Core language into the HOL mechanized reasoning system. HOL theories of the Core syntax and dynamic semantics are presented, including a purely definitional representation of the semantic inference rules. The correctness of the representation is demonstrated by the derivation of several important language properties, including determinacy. A symbolic evaluator to assist in proving properties of Standard ML program fragments is also described. Some sample applications of the theory in the area of program verification are given. A recurring theme in the work is the need for logical precision in all aspects of a HOL representation. 1 Introduction The Formal Definition of Standard ML was completed by Milner, Tofte and Harper in 1990 [14]. The aim of the definition was to give a rigorous and complete mathematical description of all aspects of the language, from its syntax to the semantics of in...
A Type System that Reconciles Classes and Extents
- In 3rd International Workshop on Database Programming Languages
"... We present a type system that naturally couples two dierent, and apparently contradictory, notions of inheritance that occur in object-oriented databases. To do this we distinguish between the type and a kind of a value. A type describes the entire structure of a value, while a kind describes only ..."
Abstract
-
Cited by 12 (4 self)
- Add to MetaCart
We present a type system that naturally couples two dierent, and apparently contradictory, notions of inheritance that occur in object-oriented databases. To do this we distinguish between the type and a kind of a value. A type describes the entire structure of a value, while a kind describes only the availability of certain elds or methods. This distinction allows us to manipulate heterogeneous collections (collections of values with diering types) in a statically type-checked language. Moreover, the type system is polymorphic and types may be inferred using an extension of the technique used in ML. This means that it is easy to express general-purpose operations for the manipulation of heterogeneous collections. We believe that this system not only provides a natural approach to static type-checking in object-oriented databases; it also oers a technique for dealing with external databases in a statically typed language. 1 Introduction The term \inheritance" is used in ...
Functions as Passive Constraints in LIFE
- ACM Transactions on Programming Languages and Systems
, 1994
"... LIFE is an experimental programming language proposing to integrate logic programming, functional programming, and object-oriented programming. It replaces first-order terms with ψ-terms, data structures which allow computing with partial information. These are approximation structures denoting se ..."
Abstract
-
Cited by 12 (4 self)
- Add to MetaCart
LIFE is an experimental programming language proposing to integrate logic programming, functional programming, and object-oriented programming. It replaces first-order terms with ψ-terms, data structures which allow computing with partial information. These are approximation structures denoting sets of values. LIFE further enriches the expressiveness of ψ-terms with functional dependency constraints. We must explain the meaning and use of functions in LIFE declaratively as solving partial information constraints. These constraints do not attempt to generate their solutions but behave as demons filtering out anything else.

