
25 Nov
2008
25 Nov
'08
12:52 p.m.
Hello, I'm just reading through Real World Haskell - chapter 6 (typeclasses). The definition of Eq is shown, and it mentions that you can define either one or both of the two classes. What would happen if I were two define both == and /= for an instance, in such a way that they were not opposites? If I were doing this in Eiffel, the function definitions would have postconditions to state the relationships, and the first execution would trigger a violation, telling me what was wrong. Is there any similar facility in Haskell? -- Colin Adams Preston Lancashire