On Fri, Aug 6, 2010 at 4:46 PM, Stephan Friedrichs <span dir="ltr"><<a href="mailto:deduktionstheorem@web.de">deduktionstheorem@web.de</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 06/08/10 15:59, Johan Tibell wrote:<br>
> There are a few functions on Maps that could be implemented on IntMaps<br>
</div>> but aren't: [...]<br>
<br>
Isn't it time to seriously think about defining maps as a type family to<br>
avoid this sort of incompatibility once and for all and to enable GHC to<br>
automatically use IntMap wherever appropriate?<br>
<br>
class Map k where<br>
data Map k :: * -> *<br>
empty ...<br>
insert ...<br>
<br>
instance Map Int where<br>
data Map Int v = Data.IntMap.IntMap v<br>
...<br>
<br>
instance (Ord k) => Map k where<br>
data Map k v = Data.Map.Map k v<br>
...<br>
<br>
Or something similar?<br></blockquote><div><br></div><div>Definitely worth researching. I think we should pursue this as a separate track and fix what we have in the mean time. </div></div><br><div>Johan</div><div><br></div>