Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@best.com>
To: Eijiro Sumii <sumii@saul.cis.upenn.edu>
Cc: caml-list@inria.fr
Subject: Re: polymorphic equality and overloading
Date: Fri, 30 Jun 2000 10:08:04 -0700 (PDT)	[thread overview]
Message-ID: <Pine.BSF.4.21.0006300933350.7049-100000@shell5.ba.best.com> (raw)
In-Reply-To: <20000629171001Q.sumii@saul.cis.upenn.edu>

On Thu, 29 Jun 2000, Eijiro Sumii wrote:
> Dear Caml Developers/Users,
> 
> (sorry that I don't know French)
> 
> This might be an FAQ, but could someone please give a rationale to the
> polymorphic (in)equalities such as = and < in Caml?

(Note: I'm no type theorist, just a humble programmer)

Equality really is overloaded, but since overloading isn't easily
integrated into ML style type systems, some other solution is chosen. 
In SML, it is eqtypes, in OCaml, it is polymorphic (in)equality. 
People are working furiously on better solutions as we write. I 
read in the "ML-2000" design paper that eqtypes would go away in the 
next (standard) ML, so clearly not everyone is happy with the SML 
solution either.

> While they have a
> parametric polymorphic type 'a -> 'a -> bool, their semantics is ad
> hoc rather than parametric with respect to the type 'a (for example,
> they are undefined for functions),

Well, there is a little decidability problem for function equality... :-)

> which I found confusing to some
> users---at least, a friend of mine was confused, and chose Haskell
> (which has type classes) over Caml!

I agree that polymorphic equality is a hack, but I'd advise patience. 
It isn't clear that type classes are the best solution, and Jun Furuse 
and Pierre Weiss are working on adding some form of overloading to OCaml. 
There have been some threads on this topic in the Caml list. See 

http://caml.inria.fr/caml-list/2216.html
http://caml.inria.fr/caml-list/2218.html

-- Brian




  reply	other threads:[~2000-07-01  8:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-29 21:10 Eijiro Sumii
2000-06-30 17:08 ` Brian Rogoff [this message]
2000-06-30 17:51   ` Eijiro Sumii
2000-07-04  7:09     ` Jacques Garrigue
2000-07-04 12:42       ` Eijiro Sumii
2000-07-05  1:11         ` Jacques Garrigue
2000-07-05  2:37           ` Eijiro Sumii
2000-07-05 21:22         ` Pierre Weis
2000-07-05 21:30           ` Eijiro Sumii
2000-07-05 22:15             ` Pierre Weis
2000-07-05 23:09               ` Eijiro Sumii
2000-07-06 17:18             ` Benjamin Werner
2000-07-05 22:40 John R Harrison

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.BSF.4.21.0006300933350.7049-100000@shell5.ba.best.com \
    --to=bpr@best.com \
    --cc=caml-list@inria.fr \
    --cc=sumii@saul.cis.upenn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox