Skip to main content

ML typing, explicit polymorphism and qualified types

  • Conference paper
  • First Online:
Book cover Theoretical Aspects of Computer Software (TACS 1994)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 789))

Included in the following conference series:

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.

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

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. S.M. Blott. An approach to overloading with polymorphism. Ph.D. thesis, Department of computing science, University of Glasgow, July 1991 (draft version).

    Google Scholar 

  2. V. Breazu-Tannen, T. Coquand, C.A. Gunter and A. Scedrov. Inheritance and coercion. In IEEE Symposium on Logic in Computer Science, 1989.

    Google Scholar 

  3. P.-L. Curien and G. Ghelli. Coherence of subsumption. In Fifteenth Colloquium on Trees in Algebra and Programming. Springer Verlag LNCS 431, 1990.

    Google Scholar 

  4. L. Damas and R. Milner. Principal type schemes for functional programs. In 8th Annual ACM Symposium on Principles of Programming languages, 1982.

    Google Scholar 

  5. R. Harper and J.C. Mitchell. On the type structure of Standard ML. ACM Transactions on Programming Languages and Systems, 15, 2, April 1993.

    Google Scholar 

  6. B. Hilken and D. Rhydeheard. Towards a categorical semantics of type classes. In Theoretical aspects of computer software. Springer Verlag LNCS 526, 1991.

    Google Scholar 

  7. J.R. Hindley and J.P. Seldin. Introduction to combinators and λ-calculus. London mathematical society student texts 1. Cambridge University Press, 1986.

    Google Scholar 

  8. P. Hudak, S.L. Peyton Jones and P. Wadler (eds.). Report on the programming language Haskell, version 1.2. A CM SIGPLAN notices, 27, 5, May 1992.

    Google Scholar 

  9. M.P. Jones. A theory of qualified types. In European symposium on programming. Springer Verlag LNCS 582, 1992.

    Google Scholar 

  10. M.P. Jones. Qualified types: Theory and Practice. D. Phil. Thesis. Programming Research Group, Oxford University Computing Laboratory. July 1992.

    Google Scholar 

  11. M.P. Jones. From polymorphism to monomorphism by partial evaluation. Yale University, Department of Computer Science. Submitted for publication, July 1993.

    Google Scholar 

  12. S. Kaes. Type inference in the presence of overloading, subtyping and recursive types. In ACM Conference on LISP and functional programming San Francisco, California, June 1992.

    Google Scholar 

  13. X. Leroy. Polymorphism by name for references and continuations. In 20th Annual Symposium on Principles of Programming Languages, Charleston, South Carolina, January 1993.

    Google Scholar 

  14. R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17, 3, 1978.

    Google Scholar 

  15. R. Milner, M. Tofte and R. Harper. The definition of Standard ML. The MIT Press, 1990.

    Google Scholar 

  16. J.C. Mitchell, Polymorphic type inference and containment. In G. Huet (ed.), Logical Foundations of Functional Programming, Addison Wesley, 1990.

    Google Scholar 

  17. T. Nipkow and G. Snelting. Type classes and overloading resolution via ordersorted unification. In 5th ACM conference on Functional Programming Languages and Computer Architecture, Cambridge, MA, August 1991. Lecture notes in computer science 523, Springer Verlag.

    Google Scholar 

  18. T. Nipkow and C. Prehofer. Type checking type classes. In 20th Annual Symposium on Principles of Programming Languages, Charleston, South Carolina, January 1993.

    Google Scholar 

  19. A. Ohori. A simple semantics for ML polymorphism. In 4th International Conference on Functional Programming Languages and Computer Architecture, Imperial College, London, September 1989. ACM Press.

    Google Scholar 

  20. J.C. Reynolds. The coherence of languages with intersection types. In Theoretical aspects of computer software. Springer Verlag LNCS 526, 1991.

    Google Scholar 

  21. G. Smith. Polymorphic type inference for languages with overloading and subtyping. PhD thesis, Department of Computer Science, Cornell University, Ithaca, New York. August 1991.

    Google Scholar 

  22. S. Thatte. Type inference and implicit scaling. In European Symposium on Programming. Springer Verlag LNCS 432, 1990.

    Google Scholar 

  23. S. Thatte. Typechecking with ad hoc polymorphism.Manuscript, Department of mathematics and computer science, Clarkson University, Potsdam, NY. May 1992.

    Google Scholar 

  24. D. Volpano and G. Smith. On the complexity of ML typability with overloading. In 5th A CM conference on Functional Programming Languages and Computer Architecture. Lecture notes in computer science 523. Springer Verlag. 1991.

    Google Scholar 

  25. P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad-hoc. In ACM Principles of Programming Languages, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Masami Hagiya John C. Mitchell

Rights and permissions

Reprints and permissions

Copyright information

© 1994 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Jones, M.P. (1994). ML typing, explicit polymorphism and qualified types. In: Hagiya, M., Mitchell, J.C. (eds) Theoretical Aspects of Computer Software. TACS 1994. Lecture Notes in Computer Science, vol 789. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57887-0_90

Download citation

  • DOI: https://doi.org/10.1007/3-540-57887-0_90

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-57887-1

  • Online ISBN: 978-3-540-48383-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics