Abstract
Object-oriented programming languages are suitable for describing real-world objects, functional programming languages for algebraic values. In this paper we propose an object-oriented functional programming language, called TOFL, which combines many desired properties of the two paradigms. In particular, TOFL unifies object classes, inheritance, (method) redefinitions and late binding as in object-oriented languages, algebraic data types, higher-order functions, type classes and type inference (without type reconstruction in this paper) as in functional languages. We translate TOFL into a stratified and explicitly typed λ-calculus T with overloaded functions, where redefinitions and late binding become late binding of overloaded functions. The operational semantics of T gives a semantics and a simple prototyping implementation of TOFL.
Research partially supported by ESPRIT Basic Research WG COMPASS 6112.
Preview
Unable to display preview. Download preview PDF.
References
Special issue on type systems for object-oriented programming. J. Functional Programming, 4(2), 1994.
M. Abadi and L. Cardelli. A theory of primitive objects: second-order systems. In Proc. European Symp./ on Programming. Springer LNCS, 1994.
M. Abadi and L. Cardelli. A theory of primitive objects: untyped and first-order systems. In Proc. Theoretical Aspects of Computer Software. Springer LNCS, 1994.
Apple Computer Inc., Eastern Research and Technology. Dylan: an object-oriented dynamic language. Technical report, 1992.
D. Bobrow, L. DeMichiel, R. Gabriel, S. Keene, G. Kiczales, and D. Moon. Common List Object System Specification. SIGPLAN Notice, 23, 1988.
K. Bruce. Typing in object-oriented languages: Achieving expressibility and safety. Technical report, Williams College, 1995. http://www.cs.williams.edu/~kim/.
K. Bruce, A. Schuett, and R. van Gent. PolyTOIL: A type-safe polymorphic object-oriented language (extended abstract). In Proc. 9th ECOOP. Springer LNCS, 1995.
P. Canning, W. Cook, W. Hill, and W. Olthoff. Interfaces for strongly-typed object-oriented programming. In Proc. OOPSLA'89, pages 457–467. 1989.
L. Cardelli. A semantics of multiple inheritance. Information and Computation, 76:130–164, 1988.
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.
L. Cardelli and G. Longo. A semantics for Quest. J. of Functional programming, 1(4):417–458, 1991.
L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471–522, 1985.
G. Castagna. Covariance and contravariance: Conflict without a cause. Trans. on Prog. Lang. and Sys., 17(3), 1995.
G. Castagna. Integration of parametric and ad hoc second order polymorphism in a calculus with subtyping. Formal Aspects of Computing, 1995. To appear.
G. Castagna, G. Ghelli, and G. Longo. A calculus for overloaded functions with subtyping. Information and Computation, 1995. To appear.
W. Cook. A proposal for making eiffel type-safe. In Proc. European Conf. on Object-oriented Programming, 1989.
W. Cook, W. Hill, and P. Canning. Inheritance is not subtyping. In Proc. 17th ACM Symp. Principles of Programming Languages. 1990.
P.-L. Curien and G. Ghelli. Coherence of subsumption, minimum typing and the type checking in F ≤ . Mathematical Structiures in Computer Science, 2(1), 1992.
L. Damas and R. Milner. Principal type schemes for functional programs. In Proc. 9th ACM Symp. Principles of Programming Languages, pages 207–212, 1982.
Y.-C. Fuh and P. Mishra. Type inference with subtypes. Theoretical Computer Science, 73:155–175, 1990.
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.
G. Ghelli. A static type system for message passing. In Proc. of OOPSLA'91. 1991.
G. Ghelli. Divergence of F ≤ type checking. Tech. Rep. 5/93, University of Pisa, 1993.
J. Goguen and J. Meseguer. Order-sorted algebra I: Equational deduction for multiple inheritance, polymorphism, and partial operations. Technical report, SRI, 1989.
C. Gunter and J. Mitchell (Eds.). Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design. The MIT Press, 1994.
R. Harper and J. Mitchell. The essence of ML. In Proc. 15th ACM Symp. Principles of Programming Languages, pages 28–46, 1988.
F. Henglein. Type inference with polymrophic recursion. ACM Trans. on Prog. Lang. and Sys., 15(2):253–289, 1993.
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.
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.
J. Hughes and J. Sparud. Haskell++: An object-oriented extension of haskell. In Proc. 1995 Workshop on Haskell, 1995.
A. Kfoury, J. Tiuryn, and P. Urzyczyn. Type reconstruction in the presence of polymrophic recursion. ACM Trans. on Prog. Lang. and Sys., 15(2):290–311, 1993.
K. Läufer. Combining type classes and existential types. In Proc. Latin American Informatics Conference (PANEL). ITESM-CEM, Mexico, Sept. 1994.
K. Läufer and M. Odersky. Polymorphic type inference and abstract data types. ACM Transactions on Programming Languages and Systems, 1994.
B. Meyer. Object-Oriented Software Construction. Prentice Hall, 1988.
R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, 1990.
J. Mitchell and G. Plotkin. Abstract types have existential type. ACM Trans. on Prog. Lang. and Sys, 10(3):475–502, 1988.
A. Mycroft. Polymorphic type schemes and recursive definitions. In Proc. Int. Symposium on Programming, pages 217–228. Springer LNCS 167, 1984.
T. Nipkow and C. Prehofer. Type reconstruction for type classes. Journal of Functional Programming, 5(2):201–224, 1995.
A. Ohori. A compilation method for ML-style polymorphic record calculi. In Proc. 19th ACM Symp. Principles of Programming Languages, pages 154–165, 1992.
J. Palsberg. Efficient type inference of object types. In Proc. IEEE Symposium on Logic in Computer Science, pages 186–195, 1994.
B. Pierce and D. Turner. Simple type-theoretical foundations for object-oriented programming. J. of Functional Programming, 4(2):207–247, 1994.
B. C. Pierce. Bounded quantification is undecidable. Information and Computation, 112(1):131–165, 1994.
Z. Qian and B. Krieg-Brückner. TOFL: a typed object-oriented functional programming language with late binding. Technical report, FB Informatik, Universität Bremen, March 1996.
Z. Qian and B. Krieg-Brückner. Object-oriented functional programming and type reconstruction. Nov. 1995. Submitted for publication.
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.
G. S. Smith. Polymorphic type inference with overloading and subtyping. In J.-P. J. M.-C. Gaudel, editor, Proc. TAPSOFT'93, pages 670–685. Springer LNCS 668, 1993.
C. Strachey. Fundamental concepts in programming languages. In Lecture Notes for the Int. Summer School in Computer Programming, Copenhagen, August 1967.
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 LNCS 782, 1993.
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.
M. Wand. Complete type inference for simple objects. In Proc. 2nd IEEE Symp. Logic in Cornp. Sci., 1987. Corrigendum in Proc. 3rd IEEE Symp. Logic in Comp. Sci., 1988.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Qian, Z., Krieg-Brückner, B. (1996). Typed object-oriented functional programming with late binding. In: Cointe, P. (eds) ECOOP ’96 — Object-Oriented Programming. ECOOP 1996. Lecture Notes in Computer Science, vol 1098. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0053056
Download citation
DOI: https://doi.org/10.1007/BFb0053056
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61439-5
Online ISBN: 978-3-540-68570-8
eBook Packages: Springer Book Archive