title: How to return a boolean in Haskell
body: <p>I have been learning Haskell using learnyouahaskell, and I have run into a problem on a program I've been attempting. I want to evaluate three Num inputs representing sides of a triangle, and see if they represent a right triangle. Here is what I have so far:</p>
  
  <pre><code>isRight :: (Num a) =&gt; a -&gt; a -&gt; a -&gt; Bool
  isRight x y z = (x^2 + y^2) == z^2
  </code></pre>
  
  <p>Obviously the function will need to be longer to allow for different orders of sides, but for now I'm unable to use the function due to this error in GCHI:</p>
  
  <pre><code>Could not deduce (Eq a) arising from use of '==' from the context (Num a) 
      bound by the type signature for
          isRight :: Num a =&gt; a -&gt; a -&gt; a -&gt; Bool
      at isRight.hs:2:1-34
  </code></pre>
  
  <p>Obviously I do not understand how to return a boolean type in Haskell, and I have been unable to find any help pertaining to this problem online. I would be grateful if somebody would help to explain this to me.</p>