On Mon, Mar 10, 2008 at 10:10 AM, Adrian Hey <[EMAIL PROTECTED]> wrote:
>  >>  The Eq instance you've given violates the law that (x == y) = True
>  >>  implies x = y. Of course the Haskell standard doesn't specify this law,
>  >>  but it should.

Unless I'm missing something obvious, the example Neil gave earlier
should make it clear how impossible this requirement is:

  What if I had made the definition of Foo:

  data Foo = Foo Int (Int -> Int)

There is no way in general to decide the observational equivalence of
two values of this data type (by reduction to the halting problem).
Therefore it is impossible to write any function implementing such an
equality test.

-- 
 Denis
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to