From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA31931 for caml-red; Fri, 7 Jul 2000 16:31:51 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA00175 for ; Thu, 6 Jul 2000 01:09:48 +0200 (MET DST) Received: from dynabook.is.s.u-tokyo.ac.jp (DHCP12-11.CIS.UPENN.EDU [158.130.13.41]) by nez-perce.inria.fr (8.10.0/8.10.0) with ESMTP id e65N9l503017; Thu, 6 Jul 2000 01:09:47 +0200 (MET DST) Received: from localhost ([127.0.0.1]) by dynabook.is.s.u-tokyo.ac.jp with esmtp (Exim 3.12 #1 (Debian)) id 139yIc-0000pw-00; Wed, 05 Jul 2000 19:09:46 -0400 To: Pierre.Weis@inria.fr Cc: sumii@saul.cis.upenn.edu, caml-list@inria.fr Subject: Re: polymorphic equality and overloading In-Reply-To: <200007052215.AAA29234@pauillac.inria.fr> References: <20000705173047X.sumii@saul.cis.upenn.edu> <200007052215.AAA29234@pauillac.inria.fr> X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20000705190946V.sumii@saul.cis.upenn.edu> Date: Wed, 05 Jul 2000 19:09:46 -0400 From: Eijiro Sumii X-Dispatcher: imput version 991025(IM133) Sender: weis@pauillac.inria.fr Dear Dr. Pierre Weis, > No. As you know (and as I wrote in the Caml FAQ) the polymorphic > equality in Caml is the "equality in mathematics" for many (or most?) > datatypes. A few exceptions are (as in maths) > -- functions, for which mathematical equality needs complex demonstrations > -- quotient types using complex equivalence relations, such as > rational numbers or even reals or complex numbers. Are the exceptions really "a few"? For example---apart from (some representations of) mathematical entities such as rational numbers, complex numbers, polynomials, etc.---simple database entries like "type student = { id : int; name : string; address : string }" would have an equality different from the polymorphic equality (in the Set and Map modules, for instance). > Note also that polymorphic equality is just pratical and useful, That is exactly what I asked in my second message ("Is that just because it is often useful?"), and if the answer is yes, that's ok for me. > and not confusing at all if you know something about mathematical > entities involved in the values manipulated by Caml programs. Unfortunately, the different treatments of equality and addition (for example) *did* confuse a friend of mine. (He has a master's degree in computer science in the University of Tokyo---as I also do---and definitely knows much about mathematics and computer science.) > Choosing Haskell for the treatment of equality in the language is just (snip) > All the best for your experiments with modern programming languages Oh, I *love* OCaml.:-) As I wrote in a previous message, I'm not a Haskell advocator. (By the way, I've been programming in "modern" languages---such as Scheme, Standard ML, Caml and Haskell---for 5 years, or 15 years if you admit LOGO as a modern language.) Best wishes, // Eijiro Sumii // // currently visiting: Department of Computer and Information Science, // School of Engineering and Applied Science, University of Pennsylvania