From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 57FCABCAF for ; Wed, 29 Jun 2005 22:28:07 +0200 (CEST) Received: from hedwig1.umh.ac.be (hedwig2.umh.ac.be [193.190.193.73]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5TKS6TK018739 for ; Wed, 29 Jun 2005 22:28:07 +0200 Received: from poincare (Debian-exim@poincare.swapping.umh.ac.be [10.102.100.19]) by hedwig1.umh.ac.be (8.13.1/8.13.1) with ESMTP id j5TKS6f7929936; Wed, 29 Jun 2005 22:28:06 +0200 Received: from localhost ([127.0.0.1] ident=trch) by poincare with esmtp (Exim 4.50) id 1DnjA3-0001hS-LI; Wed, 29 Jun 2005 22:27:57 +0200 Date: Wed, 29 Jun 2005 22:27:45 +0200 (CEST) Message-Id: <20050629.222745.100792597.Christophe.Troestler@umh.ac.be> To: "O'Caml Mailing List" Subject: Re: [Caml-list] Type abstraction and (polymorphic) equality From: Christophe TROESTLER X-REF-URL: http://www.itu.dk/people/mael/mypapers/equality.ps In-Reply-To: <200506291012.30612.jon@ffconsultancy.com> References: <20050629.023111.15476874.debian00@tiscali.be> <200506291012.30612.jon@ffconsultancy.com> Organization: Universite de Mons-Hainaut (http://math.umh.ac.be/an/) X-Spook: argus red noise Verisign Delta Force Project Monarch Taiwan nuclear illuminati AIEWS condor X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.2.51 on Emacs 21.4 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.1 (www dot roaringpenguin dot com slash mimedefang) X-Miltered: at nez-perce with ID 42C30456.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 abstraction:01 christophe:01 troestler:01 christophe:01 troestler:01 umh:01 haskell:01 compilation:01 optimise:01 val:01 cheers:01 2005,:98 ...:98 ...:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, 29 Jun 2005, Jon Harrop wrote: > > On Wednesday 29 June 2005 01:31, Christophe TROESTLER wrote: > > type t = ... with compare x y = ... > > That looks lovely. Apparently a similar facility is available in > Haskell. However, there are disadvantages. Unless you're doing > whole-program compilation, you'll need to carry a compare function > with every datum. That's a huge performance cost and it probably > isn't too easy to optimise it away. Does it need to be the case? One certainly needs to tag the types with special equality functions but these tag could be generated for each program (so as to reduce the necessary tag space), couldn't they? Then, again for each program, one would provide a special tailored equality function instead of "compare_val". Does this make sense? Cheers, ChriS