<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Type variance - Page 3 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=type_variance&amp;p=2">1.Previous</a><br />
<a accesskey="3" href="page.php?w=type_variance&amp;p=4">3.Next</a>
</p>
<p>"list of Cat" will be a subtype of "list of Animal", because the list type constructor is <b>covariant</b>. This means that the subtyping relation of the simple types is preserved for the complex types. On the other hand, "function from Animal to String" is a subtype of "function from Cat to String" because the function type constructor is <b>contravariant</b> in the <a href="page.php?w=parameter_%28computer_science%29">parameter</a> type. Here, the subtyping relation of the simple types is reversed for the complex types.</p>

<p>A programming</p><p>
<a accesskey="1" href="page.php?w=type_variance&amp;p=2">1.Previous</a><br />
<a accesskey="3" href="page.php?w=type_variance&amp;p=4">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
