<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">According to the paste you gave for the JHC test run:<div><br></div><div>Here is what happens when I try to run it:<br><br>philip@desktop:~/jhctut$ ./jtree<br>Give me a tree:<br>T AND (L 1, L 2)<br><br>jtree_code.c:2670: case fell off<br>Aborted<br><div><div><br></div><div>You gave it parens not square brackets.</div><div><br></div><div>-Ross</div><div><br></div><div>On Nov 11, 2009, at 11:45 AM, Philippos Apolinarius wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">&gt; you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]'<br>&gt; as the tree, right?<br>Hi, Felipe.<br>You are right. This means that I gave the correct input to the program. As you can see, I typed 'T AND [L 1, L 2]'. Therefore, JHC was expected to parse and print it. However, it failed to parse it. The program works perfectly well in GHC. Here is the GHC output:<br><br>&gt; philip@desktop:~/jhctut$ ghc tree.hs --make<br>[1 of 1] Compiling Main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( tree.hs, tree.o )<br>Linking tree ...<br>&gt; philip@desktop:~/jhctut$ ./tree<br>Give me a tree:<br>T AND [L 1, L 2]<br>T AND [L 1,L 2]<br><br>--- On <b>Wed, 11/11/09, Felipe Lessa <i>&lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left:
 5px;"><br>From: Felipe Lessa &lt;<a href="mailto:felipe.lessa@gmail.com">felipe.lessa@gmail.com</a>&gt;<br>Subject: Re: [Haskell-cafe] Problem with JHC<br>To: <a href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a><br>Received: Wednesday, November 11, 2009, 6:23 AM<br><br><div class="plainMail">On Wed, Nov 11, 2009 at 04:32:05AM -0800, Philippos Apolinarius wrote:<br>&gt; data Op = AND | OR | NOT deriving (Show, Read)<br>&gt; data Tree= L Int | T Op [Tree] deriving (Show, Read)&nbsp;<br><br>Hmm, you see,<br><br>&gt; philip@desktop:~/jhctut$ ./jtree<br>&gt; Give me a tree:<br>&gt; T AND (L 1, L 2)<br>&gt;<br>&gt; jtree_code.c:2670: case fell off<br>&gt; Aborted<br><br>you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]'<br>as the tree, right?<br><br>--<br>Felipe.<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a ymailto="mailto:Haskell-Cafe@haskell.org" href="x-msg://504/mc/compose?to=Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></div></blockquote></td></tr></tbody></table><br>
      <hr size="1"> <a href="http://ca.promos.yahoo.com/jacko/">Get the name you've always wanted </a>! <strong>@ymail.com </strong>or <strong>@rocketmail.com</strong>._______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/haskell-cafe<br></blockquote></div><br></div></body></html>