Type Classes are Signatures of Abstract Types
- 26 Downloads
The generalization of type classes to abstract types has the advantage of greater expressiveness: We can model polymorphic abstract types and heterogeneous data structures, concepts which cannot be expressed in Haskell. An example of a polymorphic abstract type is ∀α.Bag α, the abstract type of all bags with elements of type α. In Haskell, we would either have to fix the element type, or we would have to fix the implementation of Bag.
Our extension shares the desirable properties of the type class approach in that it is fully static and in that type reconstruction is feasible.
KeywordsType Class Type Inference Existential Quantifier Concrete Type Abstract Type
Unable to display preview. Download preview PDF.
- P. Canning, W. Cook, W. Hill, W. Olthoff, and J. Mitchell. F-bounded polymorphism for object-oriented programming. In Proc. Functional Programming and Computer Architecture, pages 273–280, 1989.Google Scholar
- L. Cardelli and P. Wegner. On understanding types, data abstraction and polymorphism. ACM Computing Surveys, 17 (4): 471–522, Dec. 1985.Google Scholar
- W. Cook. A proposal for making Eiffel type-safe. Computer Journal,32(4):305311, 1989.Google Scholar
- G. Cormack and A. Wright. Type-dependent parameter inference. In Proc. SIGPLAN’90 Conf. on Programming Language Design and Implementation, pages 127–136, White Plains, NY, June 1990.Google Scholar
- L. Damas and R. Milner. Principal type schemes for functional programs. In Proc. 9th Annual ACM Symp. on Principles of Programming Languages, pages 207–212, Jan. 1982.Google Scholar
- F. Henglein and H. Mairson. The complexity of type inference for higher-order typed lambda calculi. In Proc. 18th ACM Symp. on Principles of Programming Languages (POPL), Orlando, Florida, Jan. 1991.Google Scholar
- S. Kaes. Parametric overloading in polymorphic programming languages. In H. Ganzinger, editor, Proc. 2nd European Symosium on Programming, Lecture Notes in Computer Science, Vol. 300, pages 131–144, Nancy, France, March 1988. Springer-Verlag.Google Scholar
- K. Läufer and M. Odersky. Type inference for an object-oriented extension of ML. NYU-CIMS Report, New York University, Department of Computer Science, in preparation.Google Scholar
- D. MacQueen. Using dependent types to express modular structure. In Proc. 13th ACM Symp. on Principles of Programming Languages, pages 277–286. ACM, Jan. 1986.Google Scholar
- R. Milner, M. Tofte., and R. Harper. The Definition of Standard ML. MIT Press, 1990.Google Scholar
- J. Mitchell, S. Meldal, and N. Madhay. An extension of Standard ML modules with subtyping and inheritance. In Proc. ACM Symp. on Principles of Programming LanguagesJan. 1991. Google Scholar
- J. Mitchell and G. Plotkin. Abstract Types have Existential Type. InProc. 12th ACM Symp. on Principles of Programming Languagespages 37–51. ACM, Jan. 1985. Google Scholar
- T. Niphow and G. Snelting. Type classes and overloading resolution via order-sorted unification. Technical Report PI-R8/90, Technische Hochschule Darmstadt, Praktische Informatik, July 1990.Google Scholar
- J. Palsberg and M. Schwartzbach. Type substitution for object-oriented programming. In N. Meyrowitz, editor,Proc. Conf. Object-Oriented Programming: Systems Languages and Applications and European Conf. on Object-Oriented Programmingpages 151–160, Ottawa, Canada, Oct. 1990. ACM Press. Google Scholar
- D. Sandberg. An alternative to subclassing. In Proc. Object-Oriented Programming: Languages, Systems and Applications, pages 424–428, 1986.Google Scholar
- S. Thatte. Type inference with partial types. In Proc. Intl Conf. on Algorithms, Languages and Programming, pages 615–629, 1988.Google Scholar
- P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In Proc. 16th Annual ACM Symp. on Principles of Programming Languages,pages 6076. ACM, Jan. 1989.Google Scholar