Results 11 - 20
of
33
Polymorphic Type Inference for Languages with Overloading and Subtyping
, 1991
"... Many computer programs have the property that they work correctly on a variety of types of input; such programs are called polymorphic. Polymorphic type systems support polymorphism by allowing programs to be given multiple types. In this way, programs are permitted greater flexibility of use, while ..."
Abstract
-
Cited by 19 (1 self)
- Add to MetaCart
Many computer programs have the property that they work correctly on a variety of types of input; such programs are called polymorphic. Polymorphic type systems support polymorphism by allowing programs to be given multiple types. In this way, programs are permitted greater flexibility of use, while still receiving the benefits of strong typing. One especially successful polymorphic type system is the system of Hindley, Milner, and Damas, which is used in the programming language ML. This type system allows programs to be given universally quantified types as a means of expressing polymorphism. It has two especially nice properties. First, every well-typed program has a “best ” type, called the principal type, that captures all the possible types of the program. Second, principal types can be inferred, allowing programs to be written without type declarations. However, two useful kinds of polymorphism cannot be expressed in this type system: overloading and subtyping. Overloading is the kind of polymorphism exhibited by a function like addition, whose types cannot be captured by a single universally quantified type formula.
Parametric Type Classes (Extended Abstract)
- In ACM conference on LISP and Functional Programming
, 1992
"... ) Kung Chen, Paul Hudak, Martin Odersky Yale University, Department of Computer Science, Box 2158 Yale Station, New Haven, CT 06520 ACM Conf. on LISP and Functional Programming, June 1992 Abstract We propose a generalization to Haskell's type classes where a class can have type parameters besid ..."
Abstract
-
Cited by 15 (0 self)
- Add to MetaCart
) Kung Chen, Paul Hudak, Martin Odersky Yale University, Department of Computer Science, Box 2158 Yale Station, New Haven, CT 06520 ACM Conf. on LISP and Functional Programming, June 1992 Abstract We propose a generalization to Haskell's type classes where a class can have type parameters besides the placeholder variable. We show that this generalization is essential to represent container classes with overloaded data constructor and selector operations. We also show that the resulting type system has principal types and present unification and type reconstruction algorithms. 1 Introduction Haskell's type classes provide a structured way to introduce overloaded functions, and are perhaps the most innovative (and somewhat controversial) aspect of the language design [HJW91]. Type classes permit the definition of overloaded operators in a rigorous and (fairly) general manner that integrates well with the underlying Hindley-Milner type system. As a result, operators that are monomor...
Functional logic overloading
, 2002
"... Functional logic overloading is a novel approach to userdefined overloading that extends Haskell’s concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on ..."
Abstract
-
Cited by 15 (1 self)
- Add to MetaCart
Functional logic overloading is a novel approach to userdefined overloading that extends Haskell’s concept of type classes in significant ways. Whereas type classes are conceptually predicates on types in standard Haskell, they are type functions in our approach. Thus, we can base type inference on the evaluation of functional logic programs. Functional logic programming provides a solid theoretical foundation for type functions and, at the same time, allows for programmable overloading resolution strategies by choosing different evaluation strategies for functional logic programs. Type inference with type functions is an instance of type inference with constrained types, where the underlying constraint system is defined by a functional logic program. We have designed a variant of Haskell which supports our approach to overloading, and implemented a prototype frontend for the language.
Type Classes and Constraint Handling Rules
- In First Workshop on Rule-Based Constraint Reasoning and Programming
, 2000
"... Type classes are an elegant extension to traditional, Hindley-Milner based typing systems. ..."
Abstract
-
Cited by 14 (4 self)
- Add to MetaCart
Type classes are an elegant extension to traditional, Hindley-Milner based typing systems.
Specifying C++ concepts
- In Proc. 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL
, 2006
"... C++ templates are key to the design of current successful mainstream libraries and systems. They are the basis of programming techniques in diverse areas ranging from conventional general-purpose programming to software for safetycritical embedded systems. Current work on improving templates focuses ..."
Abstract
-
Cited by 10 (0 self)
- Add to MetaCart
C++ templates are key to the design of current successful mainstream libraries and systems. They are the basis of programming techniques in diverse areas ranging from conventional general-purpose programming to software for safetycritical embedded systems. Current work on improving templates focuses on the notion of concepts (a type system for templates), which promises significantly improved error diagnostics and increased expressive power such as conceptbased overloading and function template partial specialization. This paper presents C++ templates with an emphasis on problems related to separate compilation. We consider the problem of how to express concepts in a precise way that is simple enough to be usable by ordinary programmers. In doing so, we expose a few weakness of the current specification of the C++ standard library and suggest a far more precise and complete specification. We also present a systematic way of translating our proposed concept definitions, based on use-patterns rather than function signatures, into constraint sets that can serve as convenient basis for concept checking in a compiler.
Javagi: Generalized interfaces for java
- In: ECOOP 2007, Proceedings. LNCS, Springer-Verlag (2007) 25
, 2007
"... Abstract JavaGI is an experimental language that extends Java 1.5 by generalizing the interface concept to incorporate the essential features of Haskell’s type classes. In particular, generalized interfaces cater for retroactive and constrained interface implementations, binary methods, static metho ..."
Abstract
-
Cited by 9 (1 self)
- Add to MetaCart
Abstract JavaGI is an experimental language that extends Java 1.5 by generalizing the interface concept to incorporate the essential features of Haskell’s type classes. In particular, generalized interfaces cater for retroactive and constrained interface implementations, binary methods, static methods in interfaces, default implementations for interface methods, interfaces over families of types, and existential quantification for interface-bounded types. As a result, many anticipatory uses of design patterns such as Adapter, Factory, and Visitor become obsolete; several extension and integration problems can be solved more easily. JavaGI’s interface capabilities interact with subtyping (and subclassing) in interesting ways that go beyond type classes. JavaGI can be translated to Java 1.5. Its formal type system is derived from Featherweight GJ. 1
Combining Type Classes And Existential Types
, 1994
"... This paper demonstrates that the novel combination of type classes and existential types adds significant expressive power to a language, requiring only a minor syntactic change. We explore this combination in the context of higher-order functional languages with static typing, parametric polymorphi ..."
Abstract
-
Cited by 8 (0 self)
- Add to MetaCart
This paper demonstrates that the novel combination of type classes and existential types adds significant expressive power to a language, requiring only a minor syntactic change. We explore this combination in the context of higher-order functional languages with static typing, parametric polymorphism, algebraic data types, and Hindley-Milner type inference. Since we have examined the underlying type-theoretic issues already, this paper focuses on the practical aspects of our extension. We first examine limitations of existing functional and object-oriented languages. We then give examples to demonstrate how our first-class abstract types with user-defined interfaces address those limitations. Finally, we give an informal description of the translation from our language to a target language without type classes. Our extension equally applies to other languages with similar type systems and is independent of strictness considerations. It has been implemented in the Chalmers Haskell B. s...
Type Inference for Overloading without Restrictions, Declarations or Annotations
, 1999
"... . This article presents a type system based on the DamasMilner system[DM82], that supports overloading. Types of overloaded symbols are constrained polymorphic types. The work is related to Haskell type classes[Wad89,NP93,HHJW96], System O[OWW95] and other similar type systems[Kae88,Smi91,Jon94, ..."
Abstract
-
Cited by 8 (5 self)
- Add to MetaCart
. This article presents a type system based on the DamasMilner system[DM82], that supports overloading. Types of overloaded symbols are constrained polymorphic types. The work is related to Haskell type classes[Wad89,NP93,HHJW96], System O[OWW95] and other similar type systems[Kae88,Smi91,Jon94,DCO96]. Restrictions imposed in these systems with respect to overloading are eliminated. User-defined global and local overloading is supported without restrictions. There is no need for declarations or annotations of any sort. No language construct is added in order to cope with overloading. The type system uses a context-dependent overloading policy, specified by a predicate used in a single inference rule. Overloading of functions defined over different type constructors is supported, as done with Haskell's constructor classes. No monomorphism restriction is required in order to solve ambiguity problems. The system uses an open-world approach, in which new overloaded definition...
Type Classes With More Higher-Order Polymorphism
- In ACM SIGPLAN International Conference on Functional Programming
, 2002
"... We propose an extension of Haskell's type class system with lambda abstractions in the type language. Type inference for our extension relies on a novel constrained unification procedure called guided higher-order unification. This unification procedure is more general than Haskell's kind-preserving ..."
Abstract
-
Cited by 4 (1 self)
- Add to MetaCart
We propose an extension of Haskell's type class system with lambda abstractions in the type language. Type inference for our extension relies on a novel constrained unification procedure called guided higher-order unification. This unification procedure is more general than Haskell's kind-preserving unification but less powerful than full higher-order unification.

