&gt; your subtype relation says A -&gt; B is a subtype of C -&gt;D whenever<br>
&gt; A is a supertype of C and B is a subtype of D, then checking subtyping is undecidable.<br><br>In fashion terms: operator (-&gt;) is contravariant in its first argument and covariant in its second.<br>;)<br><br><div class="gmail_quote">

2011/3/16 Brandon Moore <span dir="ltr">&lt;<a href="mailto:brandon_m_moore@yahoo.com">brandon_m_moore@yahoo.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

You want polymorphic variants. Check out O&#39;Caml, or MLPolyR.<br>
<br>
Subtyping is not very compatible with first-class functions. If you have<br>
subtype-bounded polymorphism<br>
(&quot;forall A a subtype of T, ...&quot;), and your subtype relation says A -&gt; B is a<br>
subtype of C -&gt;D whenever<br>
A is a supertype of C and B is a subtype of D, then checking subtyping is<br>
undecidable.<br>
<br>
I might as well mention here that in any OO language with protected methods or<br>
members, a<br>
subclass is not a subtype in any behavioral sense - and terminal coalgebras have<br>
so little structure<br>
that just working in terms of the interface doesn&#39;t seem too useful.<br>
<font color="#888888"><br>
Brandon.<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br>