From: Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt;<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
&gt;<br>
&gt; (The OOP people, of course, just don&#39;t bother trying. They use typecasts<br>
&gt; everywhere...)<br>
&gt;<br>
&gt; Do associated types solve this? Or are there still problems?<br>
<br>
Duncan showed me a definition using associated types, which I have<br>
unfortunately forgotten.<br></blockquote><div><br>Yes, associated types (or fundeps) solve this problem.  This problem of container types is one of the motivating examples behind both extensions.<br><br>I think the real problem we have with container classes has a lot more to do with what we would use them for.  That is, Haskell already has Monoid, Foldable and Traversable.  These three (especially Foldable) cover nearly everything OOP programmers would expect out of generic container operations.<br>
<br>What&#39;s missing are classes for specific data types.  That is, a Map/Dict interface, a Queue interface, and a Heap interface (probably others too, but these are the first that come to mind).  But the standard Data.Map and List (for a queue) seem good enough for most people, so there seems to be a lot of inertia to overcome for these to be popular.<br>
<br>John<br></div></div>