<div dir="ltr"><div>(I&#39;m adding glasgow-haskell-users to this; if I&#39;m remembering incorrectly someone should correct me, if not then the namespace bit should be at least mentioned if not filed as a bug.)</div><div>
<br></div>On Tue, Aug 16, 2011 at 00:44, Luite Stegeman <span dir="ltr">&lt;<a href="mailto:stegeman@gmail.com">stegeman@gmail.com</a>&gt;</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 Tue, Aug 16, 2011 at 6:33 AM, Brandon Allbery &lt;<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>&gt; wrote:<br>
&gt; On Mon, Aug 15, 2011 at 08:12, Luite Stegeman &lt;<a href="mailto:stegeman@gmail.com">stegeman@gmail.com</a>&gt; wrote:<br>&gt;&gt; -- C.hs<br>
&gt;&gt; {-# LANGUAGE TypeFamilies #-}<br>
&gt;&gt; module C where<br>
&gt;&gt;<br>
&gt;&gt; class C1 a where<br>
&gt;&gt;  data F a :: *<br>
&gt;<br>
&gt; I believe this is supposed to be syntactic sugar for a data family, so 7.0.4<br>
&gt; is wrong.  (I also think it was a known deficiency.)<br>
<br>
</div>In that case, why does module B export F, even though I imported C<br>
qualified. Within B it can only be referred to as C.F<br></blockquote><div><br></div><div>My specific recollection is that 7.0.x treated F as a data family without calling it one, which introduced some needless duplication in the code base and some oddities in usage, including possible core dumps for orphan instances.  Again, 7.2.x is the correct reference; behavior of &quot;class ... where data ...&quot; in 7.0 is not consistent.</div>
<div><br></div><div>And yes, not exporting the data-family-not-called-such was one of the inconsistencies in 7.0, 7.2&#39;s behavior being considered a bug fix for it.  7.0&#39;s behavior is actually a fairly serious bug, IIRC:  instances of C1 not defined within C.hs would not correctly associate with the non-exported data family F and the code generated for them would crash at runtime.  (Typeclasses are always global over an entire program; in effect, they are always exported, and you can&#39;t suppress it.  Therefore a data family associated with a typeclass must also be exported always.)</div>
<div><br></div><div>I suspect &quot;Within B it can only be referred to as C.F&quot; is a namespace bug, given that F must always be implicitly exported/imported to match the implicit export/import of C1.</div><div><br></div>
</div>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br>
<br>
</div>