Skip to main content

Object-oriented functional programming and type reconstruction

  • Contributions
  • Conference paper
  • First Online:

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

Abstract

This paper presents an object-oriented functional programming language core, its ML-style static type inference and a corresponding type reconstruction algorithm. The language allows object definitions as in Eiffel, algebraic value definitions as in Haskell and most code reuses in Eiffel and Haskell. The type inference combines the usual structural subtyping relation and Haskell type classes. The type reconstruction algorithm computes static types for those programs, in which explicit type annotations are given at the positions of subtyping coercions.

Research partially supported by ESPRIT Basic Research WG COMPASS 6112.

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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Special issue on type systems for object-oriented programming. J. Functional Programming, 4(2), 1994.

    Google Scholar 

  2. M. Abadi and L. Cardelli. A theory of primitive objects: second-order systems. In Proc. European Symp./ on Programming. Springer-Verlag LNCS, 1994.

    Google Scholar 

  3. M. Abadi and L. Cardelli. A theory of primitive objects: untyped and first-order systems. In Proc. Theoretical Aspects of Computer Software. Springer-Verlag LNCS, 1994.

    Google Scholar 

  4. K. Bruce. Typing in object-oriented languages: Achieving expressibility and safety. Technical report, Williams College, 1995. http://www.cs.williams.edu/kim/.

    Google Scholar 

  5. K. Bruce, A. Schuett, and R. van Gent. PolyTOIL: A type-safe polymorphic object-oriented language (extended abstract). In Proc. 9th European Conf. on Object-oriented Programming. Springer-Verlag LNCS, 1995.

    Google Scholar 

  6. P. Canning, W. Cook, W. Hill, and W. Olthoff. Interfaces for strongly-typed object-oriented programming. In Proc. OOPSLA '89, pages 457–467. ACM, 1989.

    Google Scholar 

  7. L. Cardelli. A semantics of multiple inheritance. Information and Computation, 76:130–164, 1988.

    Google Scholar 

  8. L. Cardelli. Extensible records in a pure calculus of subtyping. In C. Gunter and J. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design. The MIT Press, 1994.

    Google Scholar 

  9. L. Cardelli and G. Longo. A semantics for Quest. J. of Functional programming, 1(4):417–458, 1991.

    Google Scholar 

  10. L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471–522, 1985.

    Google Scholar 

  11. G. Castagna. Integration of parametric and ad hoc second order polymorphism in a calculus with subtyping. Formal Aspects of Computing, 1995. To appear.

    Google Scholar 

  12. G. Castagna, G. Ghelli, and G. Longo. A calculus for overloaded functions with subtyping. Information and Computation, 1995. To appear.

    Google Scholar 

  13. D. Clément, J. Despeyroux, T. Despeyroux, and G. Kahn. A simple applicative language: Mini-ML. In Proc. ACM Conf. Lisp and Functional Programming, pages 13–27, 1986.

    Google Scholar 

  14. W. Cook. A proposal for making eiffel type-safe. In Proc. European Conf. on Object-oriented Programming, 1989.

    Google Scholar 

  15. W. Cook, W. Hill, and P. Canning. Inheritance is not subtyping. In Proc. 17th ACM Symp. Principles of Programming Languages. ACM, 1990.

    Google Scholar 

  16. P.-L. Curien and G. Ghelli. Coherence of subsumption, minimum typing and the type checking in F . Mathematical Structures in Computer Science, 2(1), 1992.

    Google Scholar 

  17. L. Damas and R. Milner. Principal type schemes for functional programs. In Proc. 9th ACM Symp. Principles of Programming Languages, pages 207–212, 1982.

    Google Scholar 

  18. Y.-C. Fuh and P. Mishra. Type inference with subtypes. Theoretical Computer Science, 73:155–175, 1990.

    Google Scholar 

  19. K. Futatsugi, J. Goguen, J.-P. Jouannaud, and J. Meseguer. Principles of OBJ2. In Proc. 12th ACM Symp. Principles of Programming Languages, pages 52–66, 1985.

    Google Scholar 

  20. J. Goguen and J. Meseguer. Order-sorted algebra I: Equational deduction for multiple inheritance, polymorphism, and partial operations. Technical report, SRI, 1989.

    Google Scholar 

  21. C. Gunter and J. Mitchell (Eds.). Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design. The MIT Press, 1994.

    Google Scholar 

  22. M. Hoang and J. Mitchell. Lower bounds on type inference with subtypes. In Proc. 22nd ACM Symp. Principles of Programming Languages, pages 176–185, 1995.

    Google Scholar 

  23. 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), 1992.

    Google Scholar 

  24. J. Hughes and J. Sparud. Haskell++: An object-oriented extension of haskell. In Proc. 1995 Workshop on Haskell, 1995.

    Google Scholar 

  25. M. Jones. Simplifying and improving qualified types. In Proc. 1995 Conf. on Functional Programming Languages and Computer Architecture, 1995. Full version as Research Report YALEU/DCS/RR-1040, Yale University, June 1994.

    Google Scholar 

  26. K. Läufer. Combining type classes and existential types. In Proc. Latin American Informatics Conference (PANEL). ITESM-CEM, Mexico, Sept. 1994.

    Google Scholar 

  27. K. Läufer and M. Odersky. Polymorphic type inference and abstract data types. ACM Transactions on Programming Languages and Systems, 1994.

    Google Scholar 

  28. B. Meyer. Object-Oriented Software Construction. Prentice Hall, 1988.

    Google Scholar 

  29. R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, 1990.

    Google Scholar 

  30. J. Mitchell and G. Plotkin. Abstract types have existential type. ACM Trans. on Prog. Lang. and Sys, 10(3):475–502, 1988.

    Google Scholar 

  31. D. Nazareth. A Polymorphic Sort System for Axiomatic Specification Languages. PhD thesis, Institut für Informatik, TU München, 1995.

    Google Scholar 

  32. T. Nipkow and C. Prehofer. Type reconstruction for type classes. Journal of Functional Programming, 5(2):201–224, 1995.

    Google Scholar 

  33. T. Nipkow and G. Snelting. Type classes and overloading resolution via order-sorted unification. In Proc. 5th ACM Conf. Functional Programming Languages and Computer Architecture, pages 1–14. Springer-Verlag LNCS 523, 1991.

    Google Scholar 

  34. A. Ohori. A compilation method for ML-style polymorphic record calculi. In Proc. 19th ACM Symp. Principles of Programming Languages, pages 154–165, 1992.

    Google Scholar 

  35. J. Palsberg. Efficient type inference of object types. In Proc. IEEE Symposium on Logic in Computer Science, pages 186–195, 1994.

    Google Scholar 

  36. B. Pierce and D. Turner. Simple type-theoretical foundations for object-oriented programming. J. of Functional Programming, 4(2):207–247, 1994.

    Google Scholar 

  37. Z. Qian and B. Krieg-Brückner. Object-oriented functional programming with late binding. In Proc. 10th European. Conf. on Object-Oriented Programming. Springer-Verlag LNCS, 1996. To appear. Long version as technical report FB Informatik, Universität Bremen, March 1996.

    Google Scholar 

  38. D. Rémy. Typechecking records and variants in a natural extension of ml. In Proc. 16th ACM Symp. Principles of Programming Languages, pages 77–87, 1989.

    Google Scholar 

  39. G. S. Smith. Principal type schemes for functional programs with overloading and subtyping. Science of Computer Programming, 23:197–226, 1994.

    Google Scholar 

  40. C. Strachey. Fundamental concepts in programming languages. In Lecture Notes for the International Summer School in Computer Programming, Copenhagen, August 1967.

    Google Scholar 

  41. C. Szyperski, S. Omohundro, and S. Murer. Engineering a programming language: The type and class system for Sather. In Programming Languages and System Architectures, pages 208–227. Springer-Verlag LNCS 782, 1993.

    Google Scholar 

  42. P. Wadler and S. Blott. How to make ad-hoc polymorphism less ad hoc. In Proc. 16th ACM Symp. Principles of Programming Languages, pages 60–76, 1989.

    Google Scholar 

  43. M. Wand. Complete type inference for simple objects. In Proc. 2nd IEEE Symp. Logic in Computer Science, pages 37–44, 1987. Corrigendum in Proc. 3rd IEEE Symp. Logic in Computer Science.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Magne Haveraaen Olaf Owe Ole-Johan Dahl

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Qian, Z., Krieg-Brückner, B. (1996). Object-oriented functional programming and type reconstruction. In: Haveraaen, M., Owe, O., Dahl, OJ. (eds) Recent Trends in Data Type Specification. ADT COMPASS 1995 1995. Lecture Notes in Computer Science, vol 1130. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61629-2_58

Download citation

  • DOI: https://doi.org/10.1007/3-540-61629-2_58

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61629-0

  • Online ISBN: 978-3-540-70642-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics