From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 524EEBC0B for ; Wed, 31 Jan 2007 00:13:50 +0100 (CET) Received: from ipmail01.adl2.internode.on.net (ipmail01.adl2.internode.on.net [203.16.214.140]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l0UNDkZf010822 for ; Wed, 31 Jan 2007 00:13:48 +0100 Received: from ppp27-234.lns1.syd6.internode.on.net (HELO rosella) ([59.167.27.234]) by ipmail01.adl2.internode.on.net with ESMTP; 31 Jan 2007 09:43:44 +1030 X-IronPort-AV: i="4.13,259,1167571800"; d="scan'208"; a="81496092:sNHT74247684" Subject: Re: [Caml-list] Equality of functional values From: skaller To: Fernando Alegre Cc: Christophe TROESTLER , caml-list@inria.fr In-Reply-To: <20070130220557.GD15659@gaia.cc.gatech.edu> References: <20070130204109.GB15659@gaia.cc.gatech.edu> <20070130.220141.72363004.Christophe.Troestler@umh.ac.be> <20070130210747.GC15659@gaia.cc.gatech.edu> <20070130.224657.08208845.Christophe.Troestler@umh.ac.be> <20070130220557.GD15659@gaia.cc.gatech.edu> Content-Type: text/plain Date: Wed, 31 Jan 2007 10:13:42 +1100 Message-Id: <1170198822.6391.110.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45BFD12A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 inserting:01 inserting:01 modular:01 functors:01 g'caml:01 ocaml's:01 sourceforge:01 equality:01 equality:01 polymorphic:01 polymorphic:01 wrote:01 abstract:01 caml-list:01 On Tue, 2007-01-30 at 17:05 -0500, Fernando Alegre wrote: > There are two separate notions of equality mixed together. > My point is, should "OCaml polymorphic equality" be the > same concept at "IEEE equality"? No, this is not possible. x <> x is the IEEE test for a NaN, and cannot possibly be used in a structural equality test which is primarily required for inserting data into containers: you'd have a Set in which after inserting a value the value wasn't in the Set! > Why not wish for three separate operators (=,== and =.)? What about abstract types? The bottom line is: you can always write your own comparison functions and use them with modular functors (extensionally polymorphic), you can't get a single coherent intensionally polymorphic equality concept because programs are always using representations of value rather than the mathematical values. It is a pity we don't have G'Caml around: it may provide a convenient way to mix user defined equality with Ocaml's run time driven polymorphic structural equality. -- John Skaller Felix, successor to C++: http://felix.sf.net