title: Why are function types not always instances of Eq class?
body: <p>I am trying to understand the Eq class and while I was reading a chapter about the types in Haskell I faced the following question:</p>
  
  <p>"Explain why is not feasible in general for function types to be instances of the Eq class."</p>
  
  <p>I tried to understand by checking the type of the <code>(==)</code> function.</p>
  
  <pre><code>:t (==)
  (==) :: Eq a =&gt; a -&gt; a -&gt; Bool
  </code></pre>
  
  <p>So <code>a</code> is instance of <code>Eq</code> class, but this doesn't show that the (==) function is instance of the Eq class, does it? For me, seems that the two arguments of the function == are instances of the type Eq.</p>
  
  <pre><code>equal x1 x2 = x1 == x2
  </code></pre>
  
  <p>Is actually equivalent to (==).</p>
  
  <p>My understanding is that, is not feasible always (my above example is feasible) for function types to be instances of the Eq class because they have to have the same number of arguments (two) and return the same type (Bool).</p>
  
  <p>Although I am not sure if that is the case. Is not crystal clear what is meant for a function type to be an instance of a class.</p>