I read the easy parts of the "Associated Types with Class" and "Associated Type Synonyms" papers. An associated type synonym seems to kind of work similarly to a restricted form of class. In what way are the two following examples different?
<br><br>&nbsp;&nbsp;&nbsp; -- define a class with a type synonym, and a set of operations<br>&nbsp;&nbsp;&nbsp; class A a where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type B b<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo :: a -&gt; B b<br><br>&nbsp;&nbsp;&nbsp; instance A Int where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type B = Bool<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo = (==0)
<br><br>&nbsp;&nbsp;&nbsp; -- define two classes, and an function that .<br>&nbsp;&nbsp;&nbsp; class A a, B b where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo :: a -&gt; b<br><br>&nbsp;&nbsp;&nbsp;&nbsp; instance A Int, B Bool where<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo = (==0)<br><br>Also, has anybody written a paper on the differences between typeclasses + associated types and ML's module system + overloading?
<br><br>Thanks,<br>Brian<br>