From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0D8BCBCAF for ; Thu, 30 Jun 2005 01:39:25 +0200 (CEST) Received: from mail21.sea5.speakeasy.net (mail21.sea5.speakeasy.net [69.17.117.23]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5TNdMhl002347 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 30 Jun 2005 01:39:24 +0200 Received: (qmail 3987 invoked from network); 29 Jun 2005 23:39:19 -0000 Received: from shell1.sea5.speakeasy.net ([69.17.116.2]) (envelope-sender ) by mail21.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 29 Jun 2005 23:39:19 -0000 Date: Wed, 29 Jun 2005 16:39:19 -0700 (PDT) From: brogoff X-X-Sender: brogoff@shell1.sea5.speakeasy.net To: Christophe TROESTLER Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Type abstraction and (polymorphic) equality In-Reply-To: <20050629.153210.99062320.debian00@tiscali.be> Message-ID: References: <20050629.023111.15476874.debian00@tiscali.be> <200506291012.30612.jon@ffconsultancy.com> <20050629.153210.99062320.debian00@tiscali.be> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 42C3312A.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 overloading:01 u-tokyo:01 furuse:01 'a-:01 bool:01 bug:01 ocaml:01 compiler:01 2005,:98 ...:98 wrote:01 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, Christophe TROESTLER wrote: > Well I was more thinking of overloading equality in a GCaml manner > (http://www.yl.is.s.u-tokyo.ac.jp/~furuse/gcaml/) which offers you > more, not less. That's one way to go about it, though GCaml still provides polymorphic equality, so if you write your generic function so that there's a catch all 'a-> 'a -> bool branch which uses that equality, the bug/flaw can still bite you. It would be best if GCaml (and OCaml?) do away with polymorphic equality, or at least give it some ugly name to prevent it's accidental misuse. Type classes would be another option, but people don't like the redundancy with the ML module system. Maybe some future ML will be based on type classes and a simple non-parameterized module system, so However, I do not know how much GCaml actually tries > to reduce the performance hit by compiling monomorphically whenever > possible... There's not even a native code compiler yet, so I wouldn't worry to much about it just now. -- Brian