title: Why can't Haskell infer Tree type?
body: <p>I followed the book to define Tree data type, but show doesn't work correctly. Why?</p>
  
  <pre><code>data Tree a = EmptyTree | Node a (Tree a) (Tree a) deriving (Show)
  
  test = show EmptyTree
  </code></pre>
  
  <p>gives the error message:</p>
  
  <pre><code>No instance for (Show a0) arising from a use of ???show???
  The type variable ???a0??? is ambiguous
  Note: there are several potential instances:
    instance Show a =&gt; Show (Tree a)
      -- Defined at /Users/gzhao/Documents/workspace/hsTest2/src/Tree.hs:3:62
    instance Show Double -- Defined in ???GHC.Float???
    instance Show Float -- Defined in ???GHC.Float???
    ...plus 25 others
  In the expression: show EmptyTree
  In an equation for ???test???: test = show EmptyTree
  </code></pre>