[Haskell-cafe] Re: (flawed?) benchmark : sort

Denis Bueno dbueno at gmail.com
Mon Mar 10 11:00:19 EDT 2008

On Mon, Mar 10, 2008 at 10:10 AM, Adrian Hey <ahey at iee.org> 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.


More information about the Haskell-Cafe mailing list