<div dir="ltr">On Tue, Jan 3, 2012 at 05:50, Yucheng Zhang <span dir="ltr">&lt;<a href="mailto:yczhang89@gmail.com">yczhang89@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, Jan 3, 2012 at 6:44 PM, Brandon Allbery &lt;<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>&gt; wrote:<br>
&gt; On Tue, Jan 3, 2012 at 05:17, Yucheng Zhang &lt;<a href="mailto:yczhang89@gmail.com">yczhang89@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; subsome :: [RRule nt t s] -&gt; Either String ([t], s)<br>
&gt;&gt;<br>
&gt;&gt; It seems to me that the compiler is not sure the two &#39;nt&#39; are equal.<br>
&gt;&gt; The ScopedTypeVariables can make the compiler believe they are equal.<br>&gt;<br>
&gt; But ScopedTypeVariables is enabled already.<br><br>
</div>Sorry, I meant actually using ScopedTypeVariables as in the first function,<br>
which compiles well:<br>
<div class="im"><br>
legSome :: LegGram nt t s -&gt; nt -&gt; Either String ([t], s)<br>
</div></blockquote><div><br></div><div>Except he&#39;s not; an explicit &quot;forall&quot; is needed to indicate the type variables to be brought into scope.  It would need to be</div><div><br></div><div>&gt; legSome :: forall nt t s. LegGram nt t s -&gt; nt -&gt; Either String ([t], s)</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>