
23 Aug
2010
23 Aug
'10
3:28 a.m.
I tried to reproduce the definition of Eq with class Eq a where (==), (/=) :: a -> a -> Bool (/=) = not (==) (==) = not (/=) and got Couldn't match expected type `Bool' against inferred type `a1 -> a1 -> Bool' In the first argument of `not', namely `(==)' In the expression: not (==) In the definition of `/=': /= = not (==) Couldn't match expected type `Bool' against inferred type `a1 -> a1 -> Bool' In the first argument of `not', namely `(/=)' In the expression: not (/=) In the definition of `==': == = not (/=) What have I done wrong? Is it not possible to define Eq in point-free style?