Results 1 -
6 of
6
Type classes in Haskell
- ACM Transactions on Programming Languages and Systems
, 1996
"... This paper de nes a set of type inference rules for resolving overloading introduced by type classes. Programs including type classes are transformed into ones which may be typed by the Hindley-Milner inference rules. In contrast to other work on type classes, the rules presented here relate directl ..."
Abstract
-
Cited by 111 (5 self)
- Add to MetaCart
This paper de nes a set of type inference rules for resolving overloading introduced by type classes. Programs including type classes are transformed into ones which may be typed by the Hindley-Milner inference rules. In contrast to other work on type classes, the rules presented here relate directly to user programs. An innovative aspect of this work is the use of second-order lambda calculus to record type information in the program. 1.
Principal Type Schemes for Functional Programs with Overloading and Subtyping
- Science of Computer Programming
, 1994
"... We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and ..."
Abstract
-
Cited by 40 (1 self)
- Add to MetaCart
We show how the Hindley/Milner polymorphic type system can be extended to incorporate overloading and subtyping. Our approach is to attach constraints to quantified types in order to restrict the allowed instantiations of type variables. We present an algorithm for inferring principal types and prove its soundness and completeness. We find that it is necessary in practice to simplify the inferred types, and we describe techniques for type simplification that involve shape unification, strongly connected components, transitive reduction, and the monotonicities of type formulas.
Type Checking Type Classes
- IN PROC. 20TH ACM SYMP. PRINCIPLES OF PROGRAMMING LANGUAGES
, 1993
"... We study the type inference problem for a system with type classes as in the functional programming language Haskell. Type classes are an extension of ML-style polymorphism with overloading. We generalize Milner's work on polymorphism by introducing a separate context constraining the type variables ..."
Abstract
-
Cited by 30 (2 self)
- Add to MetaCart
We study the type inference problem for a system with type classes as in the functional programming language Haskell. Type classes are an extension of ML-style polymorphism with overloading. We generalize Milner's work on polymorphism by introducing a separate context constraining the type variables in a typing judgement. This leads to simple type inference systems and algorithms which closely resemble those for ML. In particular we present a new unification algorithm which is an extension of syntactic unification with constraint solving. The existence of principal types follows from an analysis of this unification algorithm.
Type Reconstruction for Type Classes
, 1995
"... We study the type inference problem for a system with type classes as in the functional programming language Haskell. Type classes are an extension of ML-style polymorphism with overloading. We generalize Milner's work on polymorphism byintroducing a separate context constraining the type variables ..."
Abstract
-
Cited by 24 (8 self)
- Add to MetaCart
We study the type inference problem for a system with type classes as in the functional programming language Haskell. Type classes are an extension of ML-style polymorphism with overloading. We generalize Milner's work on polymorphism byintroducing a separate context constraining the type variables in a typing judgement. This leads to simple type inference systems and algorithms which closely resemble those for ML. In particular we present a new unification algorithm which is an extension of syntactic unification with constraint solving. The existence of principal types follows from an analysis of this unification algorithm.
ML typing, explicit polymorphism and qualified types
- In TACS '94: Conference on theoretical aspects of computer software
, 1994
"... Abstract. The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as core-ML, whose evaluation could be guaranteed not to “go wrong”. In subsequent work, the terms of core-ML have also been viewed as a ‘convenient shorth ..."
Abstract
-
Cited by 10 (1 self)
- Add to MetaCart
Abstract. The ML type system was originally introduced as a means of identifying a class of terms in a simple untyped language, often referred to as core-ML, whose evaluation could be guaranteed not to “go wrong”. In subsequent work, the terms of core-ML have also been viewed as a ‘convenient shorthand ’ for programs in typed languages. Notable examples include studies of ML polymorphism and investigations of overloading, motivated by the use of type classes in Haskell. In this paper, we show how qualified types, originally developed to study type class overloading, can be used to explore the relationship between core-ML programs and their translations in an explicitly typed language. Viewing these two distinct applications as instances of a single framework has obvious advantages; many of the results that have been established for one can also be applied to the other. We concentrate particularly on the issue of coherence, establishing sufficient conditions to guarantee that all possible translations of a given core-ML term are equivalent. One of the key features of this work is the use of conversions, similar to Mitchell’s retyping functions, to provide an interpretation of the ordering between type schemes in the target language. 1
Programming in the Large: the Algebraic-Functional Language Opal 2alpha
- In Implementation of Functional Languages, (IFL'97), Selected Papers, volume 1467 of LNCS
, 1998
"... We present design aspects of the algebraic-functional language Opal 2alpha, which features exible modularization to support programming in the large. Opal 2alpha provides parameterized structures and theories as part of packages. Parameterized theories serve to specify properties of functions and ar ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
We present design aspects of the algebraic-functional language Opal 2alpha, which features exible modularization to support programming in the large. Opal 2alpha provides parameterized structures and theories as part of packages. Parameterized theories serve to specify properties of functions and are shown -- along with partial instantiations -- to play a similar role to type classes in Haskell. Structures can be viewed as (mere) interfaces or as concrete implementations. A realization relation between structures tells us which implementation realizes which interface. A package is a kind of folder for structures and theories. Packages establish exible name spaces via an import relation. Name spaces, overloading and instance derivation are based on a well-established annotation concept.

