<div dir="ltr">On Tue, Jan 3, 2012 at 05:50, Yucheng Zhang <span dir="ltr"><<a href="mailto:yczhang89@gmail.com">yczhang89@gmail.com</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 Tue, Jan 3, 2012 at 6:44 PM, Brandon Allbery <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:<br>
> On Tue, Jan 3, 2012 at 05:17, Yucheng Zhang <<a href="mailto:yczhang89@gmail.com">yczhang89@gmail.com</a>> wrote:<br>
>><br>
>> subsome :: [RRule nt t s] -> Either String ([t], s)<br>
>><br>
>> It seems to me that the compiler is not sure the two 'nt' are equal.<br>
>> The ScopedTypeVariables can make the compiler believe they are equal.<br>><br>
> 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 -> nt -> Either String ([t], s)<br>
</div></blockquote><div><br></div><div>Except he's not; an explicit "forall" is needed to indicate the type variables to be brought into scope. It would need to be</div><div><br></div><div>> legSome :: forall nt t s. LegGram nt t s -> nt -> 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>