Yes, but doesn&#39;t the confluence problem only occur for type synonyms that ignore one or more of the parameters? If so, this could be checked...<br><br><div class="gmail_quote">On Fri, Mar 28, 2008 at 12:04 AM, Manuel M T Chakravarty &lt;<a href="mailto:chak@cse.unsw.edu.au">chak@cse.unsw.edu.au</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hugo Pacheco:<br>
<div class="Ih2E3d">&gt; Sorry, I meant<br>
&gt;<br>
&gt; type FList a x = Either One (a,x)<br>
&gt; type instance F [a] = FList a<br>
<br>
</div>We should not allow such programs.<br>
<font color="#888888"><br>
Manuel<br>
</font><div><div></div><div class="Wj3C7c"><br>
&gt;<br>
&gt;<br>
&gt; On Thu, Mar 27, 2008 at 4:45 PM, Hugo Pacheco &lt;<a href="mailto:hpacheco@gmail.com">hpacheco@gmail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; The current implementation is wrong, as it permits<br>
&gt;<br>
&gt; &nbsp; type S a b = a<br>
&gt; &nbsp; type family F a :: * -&gt; *<br>
&gt; &nbsp; type instance F a = S a<br>
&gt;<br>
&gt; Why do we need to forbid this type instance? &nbsp;Because it breaks the<br>
&gt; confluence of equality constraint normalisation. &nbsp;Here are two<br>
&gt; diverging normalisations:<br>
&gt;<br>
&gt; &nbsp; (1)<br>
&gt;<br>
&gt; &nbsp; &nbsp; F Int Bool &nbsp;~ &nbsp;F Int Char<br>
&gt;<br>
&gt; &nbsp; ==&gt; DECOMP<br>
&gt;<br>
&gt; &nbsp; &nbsp; F Int ~ F Int, Bool ~ Char<br>
&gt;<br>
&gt; &nbsp; ==&gt; FAIL<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; (2)<br>
&gt;<br>
&gt; &nbsp; &nbsp; F Int Bool &nbsp;~ &nbsp;F Int Char<br>
&gt;<br>
&gt; &nbsp; ==&gt; TOP<br>
&gt;<br>
&gt; &nbsp; &nbsp; S Int Bool &nbsp;~ &nbsp;S Int Char<br>
&gt;<br>
&gt; &nbsp; ==&gt; (expand type synonym)<br>
&gt;<br>
&gt; &nbsp; &nbsp; Int &nbsp;~ &nbsp;Int<br>
&gt;<br>
&gt; &nbsp; ==&gt; TRIVIAL<br>
&gt;<br>
&gt; This does mean that a program such as<br>
&gt;<br>
&gt; type FList a = Either One ((,) a)<br>
&gt; type instance F [a] = FList a<br>
&gt;<br>
&gt; will be disallowed in further versions?<br>
&gt; Doesn&#39;t this problem occur only for type synonyms that ignore one or<br>
&gt; more of the parameters? If so, this could be checked...<br>
&gt;<br>
&gt; hugo<br>
&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>