Type signature must be
ed :: (Eq a, Integral b) => [a] -> [a] -> b
This is because your definition of ed includes the expression x == y . x and y both of type a ; in order to be able to test for equality, this type must implement the Eq , which provides the == and /= operators.
The error message you received would include something like this:
Could not deduce (Eq a) arising from a use of `==' from the context (Integral b) bound by the type signature for ed :: Integral b => [a] -> [a] -> b at /home/dave/tmp/so.hs:(2,1)-(5,26) Possible fix: add (Eq a) to the context of the type signature for ed :: Integral b => [a] -> [a] -> b
who tried to tell you this.
(Btw, your code does not handle the case when the lines have different lengths.)
source share