Version française
Home     About     Download     Resources     Contact us    
Browse thread
polymorphic equality and overloading
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eijiro Sumii <sumii@s...>
Subject: Re: polymorphic equality and overloading
Hi Jacques (and Camlers),

> The point I was trying to make is just that Ocaml, to avoid
> complications in the type system, only allows universal overloading,

That's clear, I believe, and my question was "why overload the
(in)equalities".

> I think hashing and marshalling will not bother you:

No, they don't.

> Comparison may not be always the one you expect, but in practice
> this is enough to define efficient sets and maps.

I'm not sure why it is "enough in practice", for...

> you will have to define you own comparison if you need something
> coarser

this reason, but I agree that it has some uses as you wrote.

> Haskell's solution may seem more intuitive, but it uses a much more
> complex type system, and puts the burden of writing comparisons on the
> user.

I agree.  By the way, I myself am not a Haskell devotee---I just have
a friend who has chosen Haskell over Caml because of the issues on
overloading.  I hope to see what he says after he finish the "Gentle
Introduction to Haskell" tutorial.:-)

So, to summarize everyone's replies, the polymorphic (in)equalities
exist because they are of "some" use, though they might be somewhat
confusing---Is this correct?

Eijiro