title: Typeclass in haskell
body: <p>I'm extremely new to haskell and was trying to implement a small and a simple function that takes two strings and tells me the number of same characters at the same location.</p>
  
  <pre><code>ed :: (Integral b) =&gt; [a] -&gt; [a] -&gt; b
  ed _ [] = 0
  ed [] _ = 0
  ed [] [] = 0
  ed (x:xs) (y:ys)
      | x == y = 1 + ed xs ys
      | otherwise = ed xs ys
  </code></pre>
  
  <p>this doesn't run because my typeclass definition is wrong. I have two strings and need to return an integer and hence the typeclass definition I have written above. Is there something else I need to do?</p>