Advertisement

A Simple Semantics for Polymorphic Recursion

  • William L. Harrison
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3780)

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.

Keywords

Type Class Program Language Denotational Semantic Ground Instance Lambda Calculus 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    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)Google Scholar
  2. 2.
    Girard, J.-Y.: Proofs and Types. Cambridge Tracts in Theoretical Computer Science, vol. 7. Cambridge University Press, Cambridge (1989)zbMATHGoogle Scholar
  3. 3.
    Gunter, C.A.: Semantics of Programming Languages: Structures and Techniques. MIT Press, Cambridge (1992)zbMATHGoogle Scholar
  4. 4.
    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)CrossRefGoogle Scholar
  5. 5.
    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)CrossRefGoogle Scholar
  6. 6.
    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)CrossRefGoogle Scholar
  7. 7.
    Harrison, W.L., Kieburtz, R.B.: The logic of demand in Haskell. Journal of Functional Programming 15(5) (2005)Google Scholar
  8. 8.
    Henglein, F.: Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 253–289 (1993)CrossRefGoogle Scholar
  9. 9.
    Hindley, R.J.: The principal type scheme of an object in combinatory logic. Transactions of the American Mathematical Society 146, 29–60 (1969)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    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)Google Scholar
  11. 11.
    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)CrossRefGoogle Scholar
  12. 12.
    Jones, M.: Private communicationGoogle Scholar
  13. 13.
    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)CrossRefGoogle Scholar
  14. 14.
    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)Google Scholar
  15. 15.
    Jones, M.P.: Qualified Types: Theory and Practice. Cambridge University Press, Cambridge (1994)zbMATHCrossRefGoogle Scholar
  16. 16.
    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)CrossRefGoogle Scholar
  17. 17.
    MacQueen, D.B., Plotkin, G., Sethi, R.: An ideal model for recursive polymorphic types. Information and Control 71(1/2) (1984)Google Scholar
  18. 18.
    Milner, R.: A theory of type polymorphism in programming languages. Journal of Computer and System Science 17(3), 348–375 (1978)zbMATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    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)Google Scholar
  20. 20.
    Mitchell, J.C.: Foundations for Programming Languages, 3rd edn. MIT Press, Cambridge (2000)Google Scholar
  21. 21.
    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)Google Scholar
  22. 22.
    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)CrossRefGoogle Scholar
  23. 23.
    Ohori, A.: A Study of Semantics, Types, and Languages for Databases and Object-oriented Programming. PhD thesis, University of Pennsylvania (1989)Google Scholar
  24. 24.
    Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)CrossRefGoogle Scholar
  25. 25.
    Jones, S.P. (ed.): Haskell 98 Language and Libraries, the Revised Report. Cambridge University Press, Cambridge (2003)Google Scholar
  26. 26.
    Reynolds, J.C.: Towards a theory of type structure. In: Robinet, B. (ed.) Programming Symposium. LNCS, vol. 19, pp. 408–425. Springer, Heidelberg (1974)Google Scholar
  27. 27.
    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 SystemsGoogle Scholar
  28. 28.
    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)CrossRefGoogle Scholar
  29. 29.
    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)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • William L. Harrison
    • 1
  1. 1.Dept. of Computer ScienceUniversity of MissouriColumbiaUSA

Personalised recommendations