Abstract
Polymorphic recursion is a useful extension of Hindley- Milner typing and has been incorporated in the functional programming language Haskell. It allows the expression of efficient algorithms that take advantage of non-uniform data structures and provides key support for generic programming. However, polymorphic recursion is, perhaps, not as broadly understood as it could be and this, in part, motivates the denotational semantics presented here. The semantics reported here also contributes an essential building block to any semantics of Haskell: a model for first-order polymorphic recursion. Furthermore, Haskell-style type classes may be described within this semantic framework in a straightforward and intuitively appealing manner.
This research supported in part by subcontract GPACS0016, System Information Assurance II, through OGI/Oregon Health & Sciences University.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Cousot, P.: Types as abstract interpretations, invited paper. In: Conference Record of the Twentyfourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Paris, France, January 1997, pp. 316–331. ACM Press, New York (1997)
Girard, J.-Y.: Proofs and Types. Cambridge Tracts in Theoretical Computer Science, vol. 7. Cambridge University Press, Cambridge (1989)
Gunter, C.A.: Semantics of Programming Languages: Structures and Techniques. MIT Press, Cambridge (1992)
Hall, C.V., Hammond, K., Jones, S.L.P., Wadler, P.L.: Type classes in Haskell. ACM Transactions on Programming Languages and Systems 18(2), 109–138 (1996)
Harper, R., Mitchell, J.C.: On the type structure of standard ML. ACM Transactions on Programming Languages and Systems (TOPLAS) 15(2), 211–252 (1993)
Harrison, W., Sheard, T., Hook, J.: Fine control of demand in Haskell. In: Boiten, E.A., Möller, B. (eds.) MPC 2002. LNCS, vol. 2386, pp. 68–93. Springer, Heidelberg (2002)
Harrison, W.L., Kieburtz, R.B.: The logic of demand in Haskell. Journal of Functional Programming 15(5) (2005)
Henglein, F.: Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 253–289 (1993)
Hindley, R.J.: The principal type scheme of an object in combinatory logic. Transactions of the American Mathematical Society 146, 29–60 (1969)
Hinze, R.: A new approach to generic functional programming. In: POPL 2000: Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pp. 119–132 (2000)
Hinze, R., Jeuring, J.: Generic haskell: Practice and theory. In: Backhouse, R., Gibbons, J. (eds.) Generic Programming. LNCS, vol. 2793, pp. 1–56. Springer, Heidelberg (2003)
Jones, M.: Private communication
Jones, M.P.: A system of constructor classes: overloading and implicit higher-order polymorphism. In: Proceedings of the conference on Functional programming languages and computer architecture, pp. 52–61. ACM Press, New York (1993)
Jones, M.P.: Dictionary-free overloading by partial evaluation. In: ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Orlando, Florida (June 1994)
Jones, M.P.: Qualified Types: Theory and Practice. Cambridge University Press, Cambridge (1994)
Kfoury, A.J., Tiuryn, J., Urzyczyn, P.: Type reconstruction in the presence of polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 290–311 (1993)
MacQueen, D.B., Plotkin, G., Sethi, R.: An ideal model for recursive polymorphic types. Information and Control 71(1/2) (1984)
Milner, R.: A theory of type polymorphism in programming languages. Journal of Computer and System Science 17(3), 348–375 (1978)
Mitchell, J.C., Harper, R.: The essence of ML. In: Conference Record of the 15th Annual ACM Symposium on Principles of Programming Languages (POPL 1988), pp. 28–46 (1988)
Mitchell, J.C.: Foundations for Programming Languages, 3rd edn. MIT Press, Cambridge (2000)
Mycroft, A.: Polymorphic type schemes and recursive definitions. In: Paul, M., Robinet, B. (eds.) Programming 1984. LNCS, vol. 167, pp. 217–228. Springer, Heidelberg (1984)
Ohori, A.: A Simple Semantics for ML Polymorphism. In: Proceedings of the 4th International Conference on Functional Programming Languages and Computer Architecture, pp. 281–292. Imperial College, London (1989)
Ohori, A.: A Study of Semantics, Types, and Languages for Databases and Object-oriented Programming. PhD thesis, University of Pennsylvania (1989)
Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)
Jones, S.P. (ed.): Haskell 98 Language and Libraries, the Revised Report. Cambridge University Press, Cambridge (2003)
Reynolds, J.C.: Towards a theory of type structure. In: Robinet, B. (ed.) Programming Symposium. LNCS, vol. 19, pp. 408–425. Springer, Heidelberg (1974)
Stuckey, P.J., Sulzmann, M.: A theory of overloading. ACM Transactions on Programming Languages and Systems (TOPLAS) (2004), To appear in ACM Transactions on Programming Languages and Systems
Thatte, S.R.: Semantics of type classes revisited. In: Proceedings of the 1994 ACM conference on LISP and functional programming, pp. 208–219. ACM Press, New York (1994)
Wadler, P., Blott, S.: How to make ad-hoc polymorphism less ad hoc. In: Sixteenth Annual ACM Symposium on Principles of Programming Languages, Austin, Texas, pp. 60–76 (1989)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Harrison, W.L. (2005). A Simple Semantics for Polymorphic Recursion. In: Yi, K. (eds) Programming Languages and Systems. APLAS 2005. Lecture Notes in Computer Science, vol 3780. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11575467_4
Download citation
DOI: https://doi.org/10.1007/11575467_4
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-29735-2
Online ISBN: 978-3-540-32247-4
eBook Packages: Computer ScienceComputer Science (R0)