I created a Tree structure in a file called Tree2.hs
module Tree2 ( Tree ) where data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show)
then I imported it and tried to use it as an instance of a class
import qualified Tree2 class YesNo a where yesno :: a -> Bool instance YesNo (Tree2.Tree a) where yesno EmptyTree = False yesno _ = True
But I'm getting this Error when loading it in ghci:
Not in scope: data constructor ‘EmptyTree’ Failed, modules loaded: Tree2.
Anyone know why?