Lambda the Ultimate

inactiveTopic G. Castagna. Covariance and contravariance: conflict without
started 2/5/2001; 12:35:33 PM - last post 2/5/2001; 12:35:33 PM
Ehud Lamm - G. Castagna. Covariance and contravariance: conflict without  blueArrow
2/5/2001; 12:35:33 PM (reads: 419, responses: 0)
G. Castagna. Covariance and contravariance: conflict without
In type theoretic research on object-oriented programming the ``covariance versus contravariance issue'' is a topic of continuing debate. In this short note we argue that covariance and contravariance appropriately characterize two distinct and independent mechanisms. The so-called contravariance rule correctly captures the substitutivity, or subtyping relation (that establishes which sets of codes can replace another given set in every context). A covariant relation, instead, characterizes the specialization of code (i.e., the definition of new code that replaces the old one in some particular cases). Therefore, covariance and contravariance are not opposing views, but distinct concepts that each have their place in object-oriented systems and that both can (and should) be type safely integrated in an object-oriented language.

As this subject often comes up around here, I thought I'd link this paper in.


This should be in an OOP department, I guess.
Posted to OOP by Ehud Lamm on 2/5/01; 12:36:03 PM