Results 1 -
9 of
9
A theory of overloading
- ACM Transactions on Programming Languages and Systems (TOPLAS
, 2002
"... Abstract We introduce a novel approach for debugging ill-typed programs in the Hindley/Milner system. We map the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to f ..."
Abstract
-
Cited by 52 (17 self)
- Add to MetaCart
Abstract We introduce a novel approach for debugging ill-typed programs in the Hindley/Milner system. We map the typing problem for a program to a system of constraints each attached to program code that generates the constraints. We use reasoning about constraint satisfiability and implication to find minimal justifications of type errors, and to explain unexpected types that arise. Through an interactive process akin to declarative debugging, a user can track down exactly where a type error occurs. We are able to capture various extensions of the Hindley/Milner system such as type annotations and Haskell-style type class overloading. The approach has been implemented as part of the Chameleon system.
MCORBA: A CORBA Binding for Mercury
- In Practical Applications of Declarative Languages
, 1999
"... . MCORBA is a binding to the CORBA distributed object framework for the purely declarative logic/functional language Mercury. The binding preserves the referential transparency of the language, and has several advantages over similar bindings for other strongly typed declarative languages. As far as ..."
Abstract
-
Cited by 14 (0 self)
- Add to MetaCart
. MCORBA is a binding to the CORBA distributed object framework for the purely declarative logic/functional language Mercury. The binding preserves the referential transparency of the language, and has several advantages over similar bindings for other strongly typed declarative languages. As far as we know, it is the first such binding to be bidirectional; it allows a Mercury program both to operate upon CORBA components and to provide services to other CORBA components. Whereas the Haskell binding for COM maps COM interfaces onto Haskell types, MCORBA maps CORBA interfaces onto Mercury type classes. Our approach simplifies the mapping, makes the implementation of CORBA's interface inheritance straightforward, and makes it trivial for programmers to provide several different implementations of the same interface. It uses existential types to model the operation of asking CORBA for an object that satisfies a given interface but whose representation is unknown. 1 Introduction Purely de...
Concept-Controlled Polymorphism
- In Frank Pfennig and Yannis Smaragdakis, editors, Generative Programming and Component Engineering, volume 2830 of LNCS
, 2003
"... Concepts -- sets of abstractions related by common requirements -- have a central role in generic programming. This paper proposes a general framework for using concepts to control polymorphism in different ways. First, concepts can be used to constrain parametric polymorphism, as exemplified by ..."
Abstract
-
Cited by 11 (5 self)
- Add to MetaCart
Concepts -- sets of abstractions related by common requirements -- have a central role in generic programming. This paper proposes a general framework for using concepts to control polymorphism in different ways. First, concepts can be used to constrain parametric polymorphism, as exemplified by type classes in Haskell. Second, concepts can be used to provide fine-grained control of function and operator overloading. Finally, generic functions can be overloaded (specialized) based on concepts, rather than simply on types. We describe aC ++ implementation of a new mechanism, which we call enable if , and its role in concept-controlled polymorphism.
Optimization of Mercury programs
, 1998
"... The pure logic programming language Mercury is very well suited to the development of sophisticated program transformations due to its clean semantics and strong type, mode and determinism systems. We describe the design and implementation of some of the high-level optimization passes of the Mercury ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
The pure logic programming language Mercury is very well suited to the development of sophisticated program transformations due to its clean semantics and strong type, mode and determinism systems. We describe the design and implementation of some of the high-level optimization passes of the Mercury compiler, including deforestation, constraint propagation and type specialization. Mercury's mode system allows programmers to specify when a data structure can have only one reference. We present the implementation of an optimization pass to exploit this information to reuse dead cells or insert calls to place them on a free list. Contents 1 Introduction 1 2 Mercury 1 2.1 Super-homogeneous form : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2.2 Quantification : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2.3 Type checking : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 2 2.4 Mode analysis : : : : : : : : :...
Principal type inference for GHCstyle multi-parameter type classes
- In Proc. of APLAS’06
, 2006
"... Abstract. We observe that the combination of multi-parameter type classes with existential types and type annotations leads to a loss of principal types and undecidability of type inference. This may be a surprising fact for users of these popular features. We conduct a concise investigation of the ..."
Abstract
-
Cited by 4 (4 self)
- Add to MetaCart
Abstract. We observe that the combination of multi-parameter type classes with existential types and type annotations leads to a loss of principal types and undecidability of type inference. This may be a surprising fact for users of these popular features. We conduct a concise investigation of the problem and are able to give a type inference procedure which, if successful, computes principal types under the conditions imposed by the Glasgow Haskell Compiler (GHC). Our results provide new insights on how to perform type inference for advanced type extensions. 1 Introduction Type systems are important building tools in the design of programming lan-guages. They are typically specified in terms of a set of typing rules which are formulated in natural deduction style. The standard approach towards estab-lishing type soundness is to show that any well-typed program cannot go wrong at run-time. Hence, one of the first tasks of a compiler is to verify whether aprogram is well-typed or not.
Building Constraint Solvers with HAL
, 2001
"... Experience using constraint programming to solve real-life problems has shown that nding an ecient solution to a problem often requires experimentation with dierent constraint solvers or even building a problem-specic solver. HAL is a new constraint logic programming language expressly designed ..."
Abstract
- Add to MetaCart
Experience using constraint programming to solve real-life problems has shown that nding an ecient solution to a problem often requires experimentation with dierent constraint solvers or even building a problem-specic solver. HAL is a new constraint logic programming language expressly designed to facilitate this process. In this paper we examine dierent ways of building solvers in HAL. We explain how type classes can be used to specify solver interfaces, allowing the constraint programmer to support modelling of a constraint problem independently of a particular solver, leading to easy \plug and play" experimentation. We compare a number of dierent ways of writing a simple solver in HAL: using dynamic scheduling, constraint handling rules and building on an existing solver. We also examine how external solvers may be interfaced with HAL, and approaches for removing interface overhead. 1
Trying Out Alternatives for Type Class Support in a new back end for HAL
"... The HAL language has been recently extended to support type classes. As a result, compilation to its Prolog back-end has also been modi ed to support type classes. Prolog has enough builtins to make such support readily possible, but the performance penalty seemed high enough to investigate alter ..."
Abstract
- Add to MetaCart
The HAL language has been recently extended to support type classes. As a result, compilation to its Prolog back-end has also been modi ed to support type classes. Prolog has enough builtins to make such support readily possible, but the performance penalty seemed high enough to investigate alternatives.
Beyond Type Classes
, 2002
"... We discuss type classes in the context of the Chameleon language, a Haskell-style language where overloading resolution is expressed in terms of the meta-language of Constraint Handling Rules (CHRs). In a first step, we show how to encode Haskell's single-parameter type classes into Chameleon. The e ..."
Abstract
- Add to MetaCart
We discuss type classes in the context of the Chameleon language, a Haskell-style language where overloading resolution is expressed in terms of the meta-language of Constraint Handling Rules (CHRs). In a first step, we show how to encode Haskell's single-parameter type classes into Chameleon. The encoding works by providing an approrpriate set of CHRs which mimic the Haskell conditions. We also consider constructor classes, multi-parameter type classes and functional dependencies. Chameleon provides a testbed to experiment with new overloading features. We show how some novel features such as universal quantification in context can naturally be expressed in Chameleon.

