Results 1 - 10
of
13
Type-Indexed Rows
, 2001
"... Record calculi use labels to distinguish between the elements of products and sums. This paper presents a novel variation, type-indexed rows, in which labels are discarded and the types of the elements themselves serve as indices. The calculus, TIR , can express tuples, recursive datatypes, monom ..."
Abstract
-
Cited by 32 (7 self)
- Add to MetaCart
Record calculi use labels to distinguish between the elements of products and sums. This paper presents a novel variation, type-indexed rows, in which labels are discarded and the types of the elements themselves serve as indices. The calculus, TIR , can express tuples, recursive datatypes, monomophic records, polymorphic extensible records, and closed-world style type-based overloading. Our key application of TIR , however, is to encode the \choice" types of XML, and the \unordered sequence" types of SGML. Indeed, TIR is the kernel of the language XM, a lazy functional language extending XML with polymorphism and higher-order functions. The system is built from rows, equality constraints, membership constraints and constrained parametric polymorphism. The constraint domain enjoys decidable entailment and satisfaction (in EXP). We present a type checking algorithm, and show how TIR may be implemented by a typedirected translation which replaces type-indexing by conven...
Object-oriented style overloading for Haskell
- In First Workshop on Multi-language Infrastructure and Interoperability (BABEL '01
, 2001
"... Haskell has a sophisticated mechanism for overloading identifiers with multiple definitions at distinct types. Object-oriented programming has a similar notion of overriding and overloading for methods names. Unfortunately, it is not possible to encode object-oriented overloading directly using Hask ..."
Abstract
-
Cited by 13 (3 self)
- Add to MetaCart
Haskell has a sophisticated mechanism for overloading identifiers with multiple definitions at distinct types. Object-oriented programming has a similar notion of overriding and overloading for methods names. Unfortunately, it is not possible to encode object-oriented overloading directly using Haskell overloading. This deficiency becomes particularly tiresome when Haskell programs wish to call methods imported from an object-oriented library. We present two refinements of Haskell’s type class system: Closed classes and overlapping instances. We demonstrate how we may exploit the refined system so as to be able to encode object-oriented classes within Haskell. This encoding allows us to mimic, within Haskell, the overloading resolution rules employed by object-oriented languages without the need for additional type annotations or name mangling. As a consequence, object-oriented class libraries are very convenient to import and use within Haskell. 1 The problem The purpose of this paper is to make it easy to import libraries from Java[9] or.NET[18], into a Haskell program. By “easy ” we mean that it should be as easy to use the library from Haskell than from its native language. Indeed, Haskell’s higher order features and first-class monadic values make it a powerful glue language, so if we succeed it might even be easier to use the library from Haskell than from its native language. However, these advantages will not be persuasive if things that are easy in the native language are clumsy in Haskell. That is the challenge we address here.
Restricted Data Types in Haskell
- Proceedings of the 1999 Haskell Workshop. Number
, 1999
"... The implementations of abstract type constructors must often restrict the type parameters: for example, one implementation of sets may require equality on the element type, while another implementation requires an ordering. Haskell has no mechanism to abstract over such restrictions, which can hi ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
The implementations of abstract type constructors must often restrict the type parameters: for example, one implementation of sets may require equality on the element type, while another implementation requires an ordering. Haskell has no mechanism to abstract over such restrictions, which can hinder us from replacing one implementation by another, or making several implementations instances of the same class. This paper proposes a language extension called restricted data types to address this problem. A restricted data type definition specifies a condition which argument types must satisfy for the data type to be well-formed. Every type in a program must be well-formed, and we add an explicit notation to express such requirements. Thus programmers can simply state that a type must be well-formed, rather than repeat its restriction explicitly. We explain our extension via a simulation using multi-parameter classes, which serves to specify its semantics. We show its applic...
On Generalized Records and Spatial Conjunction in Role Logic
- In 11th Annual International Static Analysis Symposium (SAS’04
, 2004
"... We have previously introduced role logic as a notation for describing properties of relational structures in shape analysis, databases and knowledge bases. A natural fragment of role logic corresponds to two-variable logic with counting and is therefore decidable. ..."
Abstract
-
Cited by 9 (4 self)
- Add to MetaCart
We have previously introduced role logic as a notation for describing properties of relational structures in shape analysis, databases and knowledge bases. A natural fragment of role logic corresponds to two-variable logic with counting and is therefore decidable.
Making Implicit Parameters Explicit
, 2005
"... In almost all languages all arguments to functions are to be given explicitly. The Haskell class system however is an exception: functions can have class predicates as part of their type signature, and dictionaries are implicitly constructed and implicitly passed for such predicates, thus relieving ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
In almost all languages all arguments to functions are to be given explicitly. The Haskell class system however is an exception: functions can have class predicates as part of their type signature, and dictionaries are implicitly constructed and implicitly passed for such predicates, thus relieving the programmer from a lot of clerical work and removing clutter from the program text. Unfortunately Haskell maintains a very strict boundary between the implicit and the explicit world; if the implicit mechanisms fail to construct the hidden dictionaries there is no way the programmer can provide help, nor is he able to override the choices made by the implicit mechanisms. In this paper we describe, in the context of Haskell, a mechanism that allows the programmer to explicitly construct implicit arguments. This extension blends well with existing resolution mechanisms, since it only overrides the default behavior. We include a description of the use of partial type signatures, which liberates the programmer from having to choose between specifying a complete type signature or no type signature at all. Finally we show how the system can easily be extended to deal with higher-order predicates, thus enabling the elegant formulation of some forms of generic programming.
Polymorphic Subtyping in O'Haskell
- APPSEM Workshop on Subtyping and Dependent Types in Programming, 2000
, 2001
"... O'Haskell is a programming language derived from Haskell by the addition of concurrent reactive objects and subtyping. Because Haskell already encompasses an advanced type system with polymorphism and overloading, the type system of O'Haskell is much richer than what is the norm in almost any widesp ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
O'Haskell is a programming language derived from Haskell by the addition of concurrent reactive objects and subtyping. Because Haskell already encompasses an advanced type system with polymorphism and overloading, the type system of O'Haskell is much richer than what is the norm in almost any widespread object-oriented or functional language. Yet there is strong evidence that O'Haskell is not a complex language to use, and that both Java and Haskell programmers can easily find their way with its polymorphic subtyping system. This paper describes the type system of O'Haskell both formally and from a programmer's point of view; the latter task is accomplished with the aid of an illustrative, real world programming example: a strongly typed interface to the graphical toolkit Tk.
Dynamic applications from the ground up
- In ACM SIGPLAN Haskell WS
, 2005
"... Abstract Some Lisp programs such as Emacs, but also the Linux kernel(when fully modularised) are mostly dynamic; i.e., apart from ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
Abstract Some Lisp programs such as Emacs, but also the Linux kernel(when fully modularised) are mostly dynamic; i.e., apart from
Gridfields: Model-Driven Data Transformation in the Physical Sciences
, 2006
"... Scientists’ ability to generate and store simulation results is outpacing their ability to analyze them via ad hoc programs. We observe that these programs exhibit an algebraic structure that can be used to facilitate reasoning and improve performance. In this dissertation, we present a formal data ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
Scientists’ ability to generate and store simulation results is outpacing their ability to analyze them via ad hoc programs. We observe that these programs exhibit an algebraic structure that can be used to facilitate reasoning and improve performance. In this dissertation, we present a formal data model that exposes this algebraic structure, then implement the model, evaluate it, and use it to express, optimize, and reason about data transformations in a variety of scientific domains. Simulation results are defined over a logical grid structure that allows a con-tinuous domain to be represented discretely in the computer. Existing approaches for manipulating these gridded datasets are incomplete. The performance of SQL queries that manipulate large numeric datasets is not competitive with that of specialized tools, and the up-front effort required to deploy a relational database makes them unpopular for dynamic scientific applications. Tools for processing multidimensional arrays can only capture regular, rectilinear grids. Visualization libraries accommodate arbitrary grids, but no algebra has been developed to simplify their use and afford optimization. Further, these libraries are data dependent—physical
Extensible Algebraic Datatypes Through Prototypes and Subtyping
, 2000
"... This paper presents a new style of functional programming. The prevalent style is to define an algebraic datatype by its constructors, and functions on it by pattern matching. Programming with prototypes, on the other hand, is one of the prevalent styles of object-oriented programming. We fuse these ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
This paper presents a new style of functional programming. The prevalent style is to define an algebraic datatype by its constructors, and functions on it by pattern matching. Programming with prototypes, on the other hand, is one of the prevalent styles of object-oriented programming. We fuse these two approaches to strive for the best of both. We propose a new functional language design for algebraic data types. Our proposal replaces the prevalent constructorbased definitional system by a prototype-based one. This is done in a way that does not affect one of the main strengths of functional programming: the use of higher-order functions defined by pattern matching on algebraic data types.
Object-Oriented Extensions of HOL
"... Introduction Higher order logic (HOL)[4] is a popular logic for verification. It is based on the simply typed, polymorphic lambda-calculus. Types are generated from type constructors and type variables. In Isabelle, one-parameter type classes have been added to HOL. These can be used to restrict ov ..."
Abstract
- Add to MetaCart
Introduction Higher order logic (HOL)[4] is a popular logic for verification. It is based on the simply typed, polymorphic lambda-calculus. Types are generated from type constructors and type variables. In Isabelle, one-parameter type classes have been added to HOL. These can be used to restrict overloading. Formalisms based on objects and records are everywhere - ranging from specification formalisms such as UML and Z to the markup language XML and objectoriented programming languages such as Java. Unfortunately, the modelling of these formalisms in HOL is complicated by the fact that objects and records are not easily expressed as HOL types. Recently, a number of methods have been suggested for the integration of records and objects into functional programming languages such as Haskell and ML. The purpose of this project is to investigate in how far these methods can be transferred to HOL. The rationale is that HOL and functional programming languages are both based on the

