<div dir="ltr">Hello,<div style><br></div><div style><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 14, 2013 at 9:52 AM, Simon Peyton-Jones <span dir="ltr">&lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt;</span> wrote:<span style="font-family:Verdana,sans-serif"> </span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<p class=""><span style="font-family:Verdana,sans-serif">Are these four failures the result of your changes?<u></u><u></u></span></p>
<p class=""><span style="font-family:Verdana,sans-serif">Should we fix the tests?</span></p></div></blockquote><div><br></div><div><div>(sorry, this went to the fun-dep thread so it probably got buried among the other e-mails).</div>
<div><br></div><div>About the tests: <span style="font-family:arial,sans-serif;font-size:13px">When I ran the type-checker tests, I got these 3 failures that I am not sure how to fix:</span></div><div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>Unexpected failures:</div><div>   should_compile  tc226 [exit code non-0] (hpc,optasm)</div><div>   should_compile  tc235 [exit code non-0] (normal,hpc,optasm)</div>
<div>   should_fail     T5684 [stderr mismatch] (normal)</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">- tc226 appears to be completely unrelated to my changes, so I imagine it is about something else?</div>
<div style="font-family:arial,sans-serif;font-size:13px">- tc235 is a program that is now rejected.  I am not sure how to fix this test as the program inside seems incorrect at many levels (e.g., it violates the FD of the class, but it also uses ambiguous methods).  I also couldn&#39;t figure out what it is testing.</div>
<div style="font-family:arial,sans-serif;font-size:13px">- T5684 is still rejected but with a different error, because one of the instances violates the FD of the class.   However, this test appears to be carefully designed to test something else, but I didn&#39;t quite follow exactly what, so I left it as is for the moment.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Would you mind taking a look and advising on what to do?  I think that the new behavior is correct for tc235 and T5684, but it would be nice to preserve whatever was originally tasted there (unless it was an artifact of the lax checking of the FDs)</div>
</div></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple">
<div><p class=""><span style="font-family:Verdana,sans-serif"><u></u></span></p>
<p class=""><span style="font-family:Verdana,sans-serif">Should the error message say “The instance decl is inconsistent with the fundeps”?  And maybe be more precise about which fundep.<u></u><u></u></span></p>
<p class=""><span style="font-family:Verdana,sans-serif"><u></u></span></p></div></div></blockquote><div style>We could do that.  The current message replaces &quot;the Coverage Condition fails for one of the functional dependencies&quot;, because I thought that it is more descriptive.   The way the tests is written---both the coverage condition, and the new one---they return just a boolean, but I could probably to return the FD that is being violated.  I&#39;ll have a go at it.</div>
<div><br></div><div> <span style="font-family:Verdana,sans-serif"> </span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<p class=""><span style="font-family:Verdana,sans-serif">I’m a bit confused.</span></p></div></blockquote><div style>About which part?   Here is an example of what we are checking for:</div><div style><br></div><div style>
class C a b | a -&gt; b</div><div style>instance C Int b -- bad instance</div><div style><br></div><div style>The instance violated the FD on the class because it implies that both `C Int Int` and `C Int Char` hold, which violated the FD.  This is what I meant by &quot;multiple uses of the instance may violate the functional dependency&quot;.  The reason I opted to go for &quot;may&quot; in the message is because strictly speaking the test is incomplete (i.e., there are somewhat contrived examples that are consistent with the FD, but would be rejected, I can send one if it&#39;d be useful?).</div>
<div style><br></div><div style>-Iavor</div><div><br></div><div><br></div></div></div></div>