Skip to main content
Log in

Kinded type inference for parameteric overloading

  • Published:
Acta Informatica Aims and scope Submit manuscript

Abstract

Parameteric overloading refers to the combination of parameteric polymorphism and overloading of polymorphic operators. The formal basis for parametric overloading, proposed by Kaes and extended by Wadler and Blott, is based on type predicates. In this paper another approach to type-checking for parameteric overloading is proposed. The resulting type system loosens some of the restrictions required of overload instance types for type-checking, while also providing fresh insight into type-checking for parameteric overloading. In this system, the kind for a type variable characterizes the set of closed type expressions which may be substituted for that variable. A theory of equality and subkinding for this system is presented, and algorithms for emptiness-checking, subkinding and intersection are provided. This kind system is used as the basis for an extension of Milner’s W algorithm for ML-style type inference to kinded type inference. Finally the kinded type system is verified to be sound and complete with respect to the system of type predicates proposed by Wadler and Blott.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Alexander Aiken, Edward L. Wimmers, and T. K. Lakshman. Soft typing with conditional types. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 163–173. ACM Press, 1994.

  2. Roberto Amadio and Luca Cardelli. Subtyping recursive types. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 104–118. ACM Press, 1991.

  3. Stephen Blott. Type inference and type classes. In Functional Programming Workshop, pages 254–265, Glasgow, Scotland, 1989. Springer-Verlag.

    Google Scholar 

  4. Peter Canning, William Cook, Walter Hill, Walter Olthoff, and John Mitchell. F-bounded polymorphism for object-oriented programming. In Proceedings of ACM Symposium on Functional Programming and Computer Architecture, pages 273–280. ACM Press, 1989.

  5. Robert Cartwright and Michael Fagan. Soft typing. In Proceedings of ACM S1GPLAN Conference on Programming Language Design and Implementation, pages 278–292. ACM Press, 1991.

  6. Kung Chen, Paul Hudak, and Martin Odersky. Parameteric type classes (extended abstract). In Proceedings of ACM Symposium on Lisp and Functional Programming, pages 170–181. ACM Press, 1992.

  7. Thierry Coquand and Gerard Huet. The calculus of constructions. Information and Computation, 76(2/3):95–120, 1988.

    Article  MATH  MathSciNet  Google Scholar 

  8. Gordon Cormack and Andrew Wright. Type-dependent parameter inference. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 127–136. ACM Press, 1990.

  9. Dominic Duggan. Polymorphic methods with self types for ML-like languages. Technical Report CS-95-03, University of Waterloo, Department of Computer Science, 1995.

  10. Dominic Duggan and John Ophel. Kinded parametric overloading. Technical Report CS-94-35, University of Waterloo, Department of Computer Science, September 1994. Supersedes CS-94-15 and CS-94-16, March 1994, and CS-93-32, August 1993.

  11. Tim Freeman and Frank Pfenning. Refinement types for ML. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 268–277. ACM Press, 1991.

  12. Kevin Hammond and Stephen Blott. Implementing Haskell type classes. In Functional Programming Workshop, pages 266–286, Glasgow, Scotland, 1989. Springer-Verlag.

    Google Scholar 

  13. Paul Hudak and Joseph Fasel. A gentle introduction to Haskell. ACM SIGPLAN Notices, 27(5), 1992.

  14. Paul Hudak, Simon Peyton-Jones, Philip Wadler, Brian Boutel, Jon Fairbairn, Joseph Fasel, Maria M. Guzman, Kevin Hammond, John Hughes, Thomas Johnsson, Richard Kieburtz, Rishiyur Nikhil, Will Partain, and John Peterson. Report on the programming language Haskell, a non-strict purely functional language, Version 1.2. ACM SIGPLAN Notices, 27(5), 1992.

  15. Mark Jones. An introduction to Gofer. Available via ftp from nebula.cs.yale.edu in pub/haskell/gofer, 1991.

  16. Mark Jones. A theory of qualified types. In European Symposium on Programming, pages 287–306. Springer-Verlag, 1992. Lecture Notes in Computer Science 582.

  17. Mark Jones. A system of constructor classes: Overloading and implicit higher-order polymorphism. In Proceedings of ACM Symposium on Functional Programming and Computer Architecture, pages 1–10. Springer-Verlag, 1993. Lecture Notes in Computer Science 594.

  18. Stefan Kaes. Parametric overloading in polymorphic programming languages. In European Symposium on Programming, pages 131–144. Springer-Verlag, 1988. Lecture Notes in Computer Science 300.

  19. Stefan Kaes. Type inference in the presence of overloading, subtyping and recursive types. In Proceedings of ACM Symposium on Lisp and Functional Programming, pages 193–204. ACM Press, 1992.

  20. John WLloyd. Foundations of Logic Programming. Springer-Verlag, 1984.

  21. Zhaohui Luo and Robert Pollack. LEGO proof development system: User’s manual. Technical Report ECS-LFCS-92-211, Laboratory for Foundations of Computer Science, Computer Science Department, University of Edinburgh, The King’s Buildings, Edinburgh EH9 3JZ, Scotland, May 1992. Updated version.

  22. A. Martelli and U. Montanari. An efficient unification algorithm. ACM Transactions on Programming Languages and Systems, 4(2):258–282, 1982.

    Article  MATH  Google Scholar 

  23. Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. The MIT Press, 1990.

  24. Prateek Mishra. Towards a theory of types for logic programming. In Proceedings of the IEEE Symposium on Logic Programming, pages 289–298. IEEE, 1984.

  25. Prateek Mishra and Uday Reddy. Declaration-free type checking. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 7–21. ACM Press, 1985.

  26. Tobias Nipkow and Christian Prehofer. Type checking type classes. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 409–418. ACM Press, 1993.

  27. Tobias Nipkow and Gregor Snelting. Type classes and overloading resolution via order-sorted unification. In Proceedings of ACM Symposium on Functional Programming and Computer Architecture, pages 1–14. Springer-Verlag, 1991. Lecture Notes in Computer Science 523.

  28. John Ophel and Dominic Duggan. Multi-Parameter Parametric Overloading. Submitted for publication, 1995.

  29. Frank Pfenning, editor. Types in Logic Programming. MIT Press, 1992.

  30. Frank Pfenning and Peter Lee. LEAP: A language with eval and polymorphism. In TAPSOFT’89: Proceedings of the International Joint Conference on Theory and Practice in Software Development, pages 345–359. Springer-Verlag, 1989. Lecture Notes in Computer Science 352.

  31. Francois Rouaix. Alcool-90: Typage de la Surcharge dans un Langage Fontionnel. PhD thesis, L’Université Paris VII, December 1990.

  32. Francois Rouaix. Safe run-time overloading. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 355–366. ACM Press, 1990.

  33. Geoffry Smith. Combining Overloading and Subtyping with Parameteric Polymorphism. PhD thesis, Cornell University, 1991.

  34. Alan Snyder. Encapsulation and inheritance in object-oriented programming languages. In Proceedings of ACM Symposium on Object-Oriented Programming: Systems, Languages and Applications, pages 38–45. ACM Press, 1986.

  35. A. Tarski. A lattice-theoretical fixed point theorem and its applications. Pacific Journal of Mathematics, 5:285–309, 1955.

    MATH  MathSciNet  Google Scholar 

  36. Denis Volpano and Geoffrey Smith. On the complexity of ML typability with overloading. In Proceedings of ACM Symposium on Functional Programming and Computer Architecture, pages 15–28. Springer-Verlag, 1991. Lecture Notes in Computer Science 523.

  37. Philip Wadler. Comprehending monads. In Proceedings of ACM Symposium on Lisp and Functional Programming, pages 61–77. ACM, June 1990.

  38. Philip Wadler and Stephen Blott. How to make ad-hoc polymorphism less ad-hoc. In Proceedings of ACM Symposium on Principles of Programming Languages, pages 60–76. ACM Press, 1989.

Download references

Author information

Authors and Affiliations

Authors

Additional information

Supported by NSERC Operating Grant 0105568.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Duggan, D., Cormack, G. & Ophel, J. Kinded type inference for parameteric overloading. Acta Informatica 33, 21–68 (1996). https://doi.org/10.1007/s002360050035

Download citation

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s002360050035

Keywords

Navigation