title: When does Haskell complain about incorrect typing in functions?
body: <p>I am a Haskell newbie trying to wrap my head around type binding in functions and how Haskell enforces it. For example, even though the type for the <code>fst</code> function is <code>fst :: (a, b) -&gt; a</code>, the compiler does not complain for the function <code>fst'</code>. But the compiler complains about type bindings for the function <code>elem'</code>.</p>
  
  <pre><code>fst' :: (a,a) -&gt; a
  fst' s = fst s
  
  elem' :: (Eq a, Eq b) =&gt; a -&gt; [b] -&gt; Bool
  elem' x xs = elem x xs
  </code></pre>