Abstract
The Hindley/Milner type system has been widely adopted as a basis for statically typed functional languages. One of the main reasons for this is that it provides an elegant compromise between flexibility, allowing a single value to be used in different ways, and practicality, freeing the programmer from the need to supply explicit type information. Focusing on practical applications rather than implementation or theoretical details, these notes examine a range of extensions that provide more flexible type systems while retaining many of the properties that have made the original Hindley/Milner system so popular. The topics discussed, some old, but most quite recent, include higher-order polymorphism and type and constructor class overloading. Particular emphasis is placed on the use of these features to promote modularity and reusability.
Preview
Unable to display preview. Download preview PDF.
References
R. Bird and P. Wadler. Introduction to functional programming. Prentice Hall, 1988.
R.M. Burstall, D.B MacQueen, and D.T. Sanella. Hope: An experimental applicative language. In The 1980 LISP Conference, pages 136–143, Stanford, August 1980.
L. Damas and R. Milner. Principal type schemes for functional programs. In 9th Annual ACM Symposium on Principles of Programming languages, pages 207–212, Albuquerque, N.M., January 1982.
David Espinosa. Modular denotational semantics. Unpublished manuscript, December 1993.
David Espinosa. Building interpreters by transforming stratified monads. Unpublished manuscript, June 1994.
R. Hindley. The principal type-scheme of an object in combinatory logic. Transactions of the American Mathematical Society, 146:29–60, December 1969.
P. Hudak, S. Peyton Jones, and P. Wadler (editors). Report on the Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.2). ACM SIGPLAN Notices, 27(5), May 1992.
Geraint Jones and Jeremy Gibbons. Linear-time breadth-first tree algorithms, an exercise in the arithmetic of folds and zips. Programming Research Group, Oxford, December 1992.
Mark P. Jones. Computing with lattices: An application of type classes. Journal of Functional Programming, 2(4), October 1992.
Mark P. Jones. A system of constructor classes: overloading and implicit higher-order polymorphism. In FPCA '93: Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, New York, June 1993. ACM Press.
Mark P. Jones. Dictionary-free overloading by partial evaluation. In ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Orlando, Florida, June 1994. To appear.
Mark P. Jones. The implementation of the Gofer functional programming system. Research Report YALEU/DCS/RR-1030, Yale University, New Haven, Connecticut, USA, May 1994.
M.P. Jones and L. Duponcheel. Composing monads. Research Report YALEU/DCS/RR-1004, Yale University, New Haven, Connecticut, USA, December 1993.
D.J. King and P. Wadler. Combining monads. In Proceedings of the Fifth Annual Glasgow Workshop on Functional Programming, Ayr, Scotland, 1992. Springer Verlag Workshops in Computer Science.
Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Conference record of POPL '95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, CA, January 1995.
S. MacLane. Categories for the working mathematician. Graduate texts in mathematics, 5. Springer-Verlag, 1971.
Erik Meijer, Maarten Fokkinga, and Ross Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In 5th ACM conference on Functional Programming Languages and Computer Architecture, pages 124–144, New York, 1991. Springer-Verlag. Lecture Notes in Computer Science, 523.
Erik Meijer and Mark P. Jones. Gofer goes bananas. In preparation, 1994.
R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17(3), 1978.
Robin Milner, Mads Tofte, and Robert Harper. The definition of Standard ML. The MIT Press, 1990.
E. Moggi. Computational lambda-calculus and monads. In IEEE Symposium on Logic in Computer Science, Asilomar, California, 1989.
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Laboratory for Foundations of Computer Science, University of Edinburgh, Edinburgh, Scotland, 1990.
Stephen K. Park and Keith W Miller. Random number generators: Good ones are hard to find. Communications of the ACM, 31(10):1192–1201, Oct 1988.
M. Spivey. A functional theory of exceptions. Science of Computer Programming, 14(1), 1990.
Guy L. Steele Jr. Building interpreters by composing monads. In Conference record of POPL '94: 21st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 472–492, Portland, OR, January 1994.
D.A. Turner. Duality and De Morgan principles for lists. In W. Feijen, N. van Gasteren, D. Gries, and J. Misra, editors, Beauty is Our Business, A Birthday Salute to Edsger W. Dijkstra, pages 390–398. Springer-Verlag, 1990.
D.A. Turner. An overview of Miranda. In David Turner, editor, Research Topics in Functional Programming, chapter 1, pages 1–16. Addison Wesley, 1990.
P. Wadler. Comprehending monads. In ACM conference on LISP and Functional Programming, Nice, France, 1990.
P. Wadler. The essence of functional programming (invited talk). In Conference record of the Nineteenth annual ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pages 1–14, Jan 1992.
P. Wadler and S. Blott. How to make ad hoc polymorphism less ad hoc. In Proceedings of 16th ACM Symposium on Principles of Programming Languages, pages 60–76, Jan 1989.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jones, M.P. (1995). Functional programming with overloading and higher-order polymorphism. In: Jeuring, J., Meijer, E. (eds) Advanced Functional Programming. AFP 1995. Lecture Notes in Computer Science, vol 925. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-59451-5_4
Download citation
DOI: https://doi.org/10.1007/3-540-59451-5_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-59451-2
Online ISBN: 978-3-540-49270-2
eBook Packages: Springer Book Archive