<p>If you don't include "Node a" then there isn't any point in having the a parameter on BinTree as it's never used unless you add another constructor that uses it. I based the modification on the usage in your example where you're trying to store a value of 3. Without that parameter the code becomes:</p>
<p>b1 = Node EmptyBinTree EmptyBinTree</p>
<p>I haven't tried it, but that will also likely complain it can't deduce "a" from the usage.</p>
<p>-R. Kyle Murphy<br>
Sent from my phone.</p>
<div class="gmail_quote">On Apr 13, 2012 1:03 PM, "Kak Dod" <<a href="mailto:kak.dod2008@yahoo.com">kak.dod2008@yahoo.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="color:#000;background-color:#fff;font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:12pt"><span style="font-family:times new roman,new york,times,serif">Thanks Tom. this is what i wanted<br>
I do not want "Node a" there, I wants only Node and Tom's solution works.<br>Thanks to all .</span><div><br></div> <div style="font-family:Courier New,courier,monaco,monospace,sans-serif;font-size:12pt"> <div style="font-family:times new roman,new york,times,serif;font-size:12pt">
<div dir="ltr"> <font face="Arial"> <hr size="1"> <b><span style="font-weight:bold">From:</span></b> Tom Murphy <<a href="mailto:amindfv@gmail.com" target="_blank">amindfv@gmail.com</a>><br> <b><span style="font-weight:bold">To:</span></b> Kak Dod <<a href="mailto:kak.dod2008@yahoo.com" target="_blank">kak.dod2008@yahoo.com</a>> <br>
<b><span style="font-weight:bold">Cc:</span></b> Kyle Murphy <<a href="mailto:orclev@gmail.com" target="_blank">orclev@gmail.com</a>>; "<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>" <<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>> <br>
<b><span style="font-weight:bold">Sent:</span></b> Friday, 13 April 2012 4:53 PM<br> <b><span style="font-weight:bold">Subject:</span></b> Re: [Haskell-beginners] error: Not in scope: data constructor `BinTree'<br> </font> </div>
<br>"(BinTree a)" needs to be in parentheses to pattern-match properly.<br><br>data BinTree a = Node (BinTree a) (BinTree) a | EmptyBinTree<br> deriving Show<br><br>On 4/13/12, Kak Dod <<a href="mailto:kak.dod2008@yahoo.com" target="_blank">kak.dod2008@yahoo.com</a>> wrote:<br>
> Thank you but<br>><br>> if I change the code like this:<br>><br>> data BinTree a = Node BinTree a BinTree a | EmptyBinTree deriving Show<br>><br>> b1 = Node 3 EmptyBinTreeEmptyBinTree<br>><br>> Then I am get this error:<br>
><br>> bintree.hs:1:23:<br>> `BinTree' is not applied to enough type arguments<br>> Expected kind `?', but `BinTree' has kind `k0 -> *'<br>>
In the type `BinTree'<br>> In the definition of data constructor `Node'<br>> In the data type declaration for `BinTree'<br>> Failed, modules loaded: none.<br>><br>><br>><br>><br>
> ________________________________<br>> From: Kyle Murphy <<a href="mailto:orclev@gmail.com" target="_blank">orclev@gmail.com</a>><br>> To: Kak Dod <<a href="mailto:kak.dod2008@yahoo.com" target="_blank">kak.dod2008@yahoo.com</a>><br>
> Cc: "<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>" <<a href="mailto:beginners@haskell.org" target="_blank">beginners@haskell.org</a>><br>> Sent: Friday, 13 April 2012 4:38 PM<br>
> Subject: Re: [Haskell-beginners] error: Not in scope: data constructor<br>> `BinTree'<br>><br>><br>> Your constructor
is called Node, not BinTree.<br>> data BinTree a = Node a (BinTree a) (BinTree a) | EmptyNode<br>> b1 = Node 3 EmptyNode EmptyNode<br>> -R. Kyle Murphy<br>> Sent from my phone.<br>> On Apr 13, 2012 12:24 PM, "Kak Dod" <<a href="mailto:kak.dod2008@yahoo.com" target="_blank">kak.dod2008@yahoo.com</a>> wrote:<br>
><br>> if i compile the following code I get "bintree.hs:3:13: Not in scope: data<br>> constructor `BinTree'"<br>>><br>>><br>>><br>>>data BinTree a = Node BinTree a BinTree a | EmptyBinTree deriving Show<br>
>><br>>>b1 = (Node (BinTree 3) EmptyBinTree)<br>>><br>>><br>>><br>>>please help<br>>><br>>><br>>>-kak<br>>><br>>><br>>>_______________________________________________<br>
>>Beginners mailing list<br>>><a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>>><a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
>><br>>><br><br><br> </div> </div> </div></div></blockquote></div>