<br><div class="gmail_quote">On Thu, Jun 16, 2011 at 4:55 PM, Alan Jeffrey <span dir="ltr"><<a href="mailto:ajeffrey@bell-labs.com">ajeffrey@bell-labs.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Adding:<br>
<br>
baz : Bool → String<br>
baz true = "true"<br>
baz false = "false"<br>
<br>
main = run (putStrLn (baz (foo 1 true)))<br>
<br>
to your file and compiling with "agda -c" shows that MAlonzo agrees with your intuition. The code generated by MAlonzo is essentially the direct translation of Agda pattern matching into Haskell pattern matching.<br>
<br>
This looks like a bug to me. (Personally I think the compiler is right and the interpreter is wrong, but there may be subtleties I'm not aware of.)<br></blockquote><div><br></div><div>The reason they disagree is that the compiler is using the Agda clauses as they stand (more or less), whereas the interpreter compiles the pattern matching to a case tree for evaluation. This looks like a bug in the case tree generation.</div>
<div><br></div><div>/ Ulf</div><div><br></div></div>