[Haskell-cafe] Problem with JHC
phi500ac at yahoo.ca
Wed Nov 11 11:45:10 EST 2009
> you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]'
> as the tree, right?
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:
> philip at desktop:~/jhctut$ ghc tree.hs --make
[1 of 1] Compiling Main ( tree.hs, tree.o )
Linking tree ...
> philip at desktop:~/jhctut$ ./tree
Give me a tree:
T AND [L 1, L 2]
T AND [L 1,L 2]
--- On Wed, 11/11/09, Felipe Lessa <felipe.lessa at gmail.com> wrote:
From: Felipe Lessa <felipe.lessa at gmail.com>
Subject: Re: [Haskell-cafe] Problem with JHC
To: haskell-cafe at haskell.org
Received: Wednesday, November 11, 2009, 6:23 AM
On Wed, Nov 11, 2009 at 04:32:05AM -0800, Philippos Apolinarius wrote:
> data Op = AND | OR | NOT deriving (Show, Read)
> data Tree= L Int | T Op [Tree] deriving (Show, Read)
Hmm, you see,
> philip at desktop:~/jhctut$ ./jtree
> Give me a tree:
> T AND (L 1, L 2)
> jtree_code.c:2670: case fell off
you declared 'T Op [Tree]' so you should give 'T AND [L 1, L 2]'
as the tree, right?
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe