[Haskell-cafe] Re: (flawed?) benchmark : sort
Adrian Hey
ahey at iee.org
Thu Mar 13 05:02:33 EDT 2008
Luke Palmer wrote:
> On Thu, Mar 13, 2008 at 1:00 AM, Adrian Hey <ahey at iee.org> wrote:
>> AFAICT the report is ambiguous about this, or at least the non-intutive
>> equality semantics are not at all clear to me from what I can see in
>> the Eq class definition (para 6.3.1). I think an the absence of any
>> clear and *explicit* statement to the contrary people are entitled to
>> assume this law is mandatory for all (correct) Eq instances.
>
> In mathematics we usually *don't* assume things that aren't stated
> assumptions.
But the trouble is the report says practically *nothing* about Eq
class or what the (==) operator means. It all seems to be assumed,
and even when it does talk about it informally it talks about
"equality", not "equivalence" or some other word.
The report doesn't state that for all Ints, (x==y = True) implies that
x=y. There's no reason to suppose the Int instance is in any way
special, so do you really seriously consider the possibility that
this might not hold in your Int related code?
if (x==y) then f x else g x y
might not mean the same as..
if (x==y) then f y else g x y
Regards
--
Adrian Hey
More information about the Haskell-Cafe
mailing list