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

Kalman Noel kalman.noel at bluebottle.com
Mon Mar 10 13:10:34 EDT 2008


Neil Mitchell wrote:
> instance Eq Foo where
>     (==) (Foo a _) (Foo b _) = (==) a b
[...]
> Please give the sane law that this ordering violates. I can't see any!

The (non-existant) law would be

    (Eq1)   x == y  =>  f x == f y,  for all f of appropriate type

which is analogous to this (existant) law about observational equality:

    (Eq2)   x = y   =>  f x = f y,   for all f of appropriate type

Kalman

----------------------------------------------------------------------
Finally - A spam blocker that actually works.
http://www.bluebottle.com/tag/4



More information about the Haskell-Cafe mailing list