[Haskell-beginners] Error while using type and data constructor

Nishant nishantgeek at gmail.com
Fri May 15 09:48:32 UTC 2015


Hi,

I was writing some code for Tree.

1 : data Tree a = NULL | Node a (Tree a) (Tree a)   works fine. But,
2  : data Tree a = NULL | Tree a (Node a) Tree a does not work. GHCI says
Not in scope " type constructor or class 'Node'.

Why is 2 declaration not valid though second definition looks much more
closer to what a binary tree actually means ?


Regards
Nishant Verma
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150515/54a3fd7a/attachment.html>


More information about the Beginners mailing list