title: Ambiguous type variable `a0' in the constraints
body: <p>I'm trying to go through the <code>YesNo</code> example from <code>Learn You a Haskell for Great Good!</code> book.</p>
  
  <p>Here is my source code:</p>
  
  <pre><code>module Main where
  
  main :: IO ()
  
  main = putStrLn ( show (yesno 12) )
  
  class YesNo a where
      yesno :: a -&gt; Bool
  
  
  instance YesNo Bool where
      yesno b = b
  
  instance YesNo [a] where
      yesno [] = False
      yesno _ = True
  
  
  instance YesNo Int where
      yesno 0 = False
      yesno _ = True
  </code></pre>
  
  <p>When I execute this code following exception occurs:</p>
  
  <pre><code>Ambiguous type variable `a0' in the constraints:
    (YesNo a0) arising from a use of `yesno'
               at /Users/mkhadikov/Projects/personal/haskell/hello-world/yesno.hs:5:25-29
    (Num a0) arising from the literal `12'
             at /Users/mkhadikov/Projects/personal/haskell/hello-world/yesno.hs:5:31-32
  Probable fix: add a type signature that fixes these type variable(s)
  In the first argument of `show', namely `(yesno 12)'
  In the first argument of `putStrLn', namely `(show (yesno 12))'
  In the expression: putStrLn (show (yesno 12))
  </code></pre>
  
  <p>Can you please explain what's wrong with this code?</p>