Abstract
We show that techniques for monad composition in functional programming can be used nicely for modeling object-oriented programming concepts. In this functional setting, we compose objects from individual features in a modular way. Features are similar to abstract subclasses, but separate the core functionality of a subclass from overwriting methods. We view method overwriting more generally as resolving interactions between two features. The interaction handling is specified separately and added when features are composed. This generalizes inheritance as found in object-oriented languages and leads to a new view of objects in a functional setting. Our concepts are implemented in Gofer using monadic programming techniques.
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
H. Barendregt. Introduction to generalized type systems. Journal of Functional Programming, 1(2):125–154 April 1991.
Gilad Bracha and William Cook. Mixin-based inheritance. ACM SIGPLAN Notices 25(10):303–311, October 1990. OOPSLA ECOOP ’90 Proceedings, N Meyrowitz (editor).
K. E. Cheng and T Ohta, editors. Feature Interactions in Telecommunications 111. IOSPress, Tokyo, Japan, Oct 1995.
D. Espinosa. Semantic Lego. PhD thesis, Columbia University, 1995.
James Gosling, Bill Joy, and Guy Steele. The Java Language Specification. Addison Wesley, September 1996.
Mark P Jones. Introduction to Gofer 2.20. Technical report, Yale University, September 1991.
M. P. Jones. A system of constructor classes: overloading and implicit higher—order polymorphism. Journal of Functional Programming, 5(1) January 1995.
Mark P Jones and Luc Duponcheel. Composing monads. Technical Report RR-1004, Yale University, December 1993.
S. L. Peyton Jones and P Wadler. Imperative functional programming. In Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages, Charleston, South Carolina pages 71–84, January 1993.
S. Liang, P Hudak, and M. Jones. Monad transformers and modular interpreters. In 22nd ACM Symposium on Principles of Programming Languages San Francisco, California, 1995.
E. Moggi. Notions of computation and monads. Information and Computation, 93(1),1991.
T. Nipkow and C. Prehofer. Type reconstruction for type classes. J. Functional Programming, 5(2):201–224, 1995. Short version appeared in POPL’93.
J. Peterson[editor], K. Hammond[editor], L. Augustsson, B. Boutel, W. Burton, J. Fasel, A. Gordon, J. Hughes, P Hudak, T. Johnsson, M. Jones, S. Peyton Jones, A. Reid, and P Wadler. Haskell 1.3, A non-strict, purely functional language. Report YALEU l DCS I RR—1106, Department of Computer Science, Yale University, May 1996.
C. Prehofer. Feature-oriented programming: A fresh look at objects. In ECOOP ’97 1997. To appear in Springer—LNCS.
Christian Prehofer. From inheritance to feature interaction or composing monads. Technical report, TU Munchen, 1997. TUM—19715.
Christian Prehofer. An object-oriented approach to feature interaction. In Fourth IEEE Workshop on Feature Interactions in Telecommunications networks and distributed systems 1997. to appear.
P. Wadler. Monalds and functional programming. In M. Broy, editor, Proceedings of the 1992 Maktoberdorf international summer school on program design calculi. Springer Verlag, 1993
P. Zave. Feature interactions and formal specifications in telecommunications. IEEE Computer, XXVI(8), August 1993.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1997 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Prehofer, C. (1997). From Inheritance to Feature Interaction or Composing Monads. In: Jarke, M., Pasedach, K., Pohl, K. (eds) Informatik ’97 Informatik als Innovationsmotor. Informatik aktuell. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-60831-5_76
Download citation
DOI: https://doi.org/10.1007/978-3-642-60831-5_76
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-63066-1
Online ISBN: 978-3-642-60831-5
eBook Packages: Springer Book Archive