From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA24883; Thu, 19 Apr 2001 23:01:38 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 XAA24905 for ; Thu, 19 Apr 2001 23:01:37 +0200 (MET DST) Received: from mail2.microsoft.com (mail2.microsoft.com [131.107.3.124]) by nez-perce.inria.fr (8.11.1/8.10.0) with SMTP id f3JL1aL13836 for ; Thu, 19 Apr 2001 23:01:36 +0200 (MET DST) Received: from 157.54.7.67 by mail2.microsoft.com (InterScan E-Mail VirusWall NT); Thu, 19 Apr 2001 14:01:34 -0700 (Pacific Daylight Time) Received: from red-msg-04.redmond.corp.microsoft.com ([157.54.12.74]) by inet-imc-04.redmond.corp.microsoft.com with Microsoft SMTPSVC(5.0.2195.2883); Thu, 19 Apr 2001 14:00:59 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.0.4418.65 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [Caml-list] User-defined equality on types? Date: Thu, 19 Apr 2001 14:00:59 -0700 Message-ID: <0C682B70CE37BC4EADED9D375809768A02DB1F0F@red-msg-04.redmond.corp.microsoft.com> Thread-Topic: [Caml-list] User-defined equality on types? Thread-Index: AcDJC3RSaFj36OXERoOj+rjRqoEMjAAB8trg From: "Don Syme" To: "Alain Frisch" , "John R Harrison" Cc: X-OriginalArrivalTime: 19 Apr 2001 21:00:59.0849 (UTC) FILETIME=[D6038390:01C0C913] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >=20 > On Wed, 18 Apr 2001, John R Harrison wrote: >=20 > > I'd like to suggest allowing the user to define a chosen=20 > interpretation > > of the equality symbol, and perhaps the polymorphic=20 > orderings too, on > > each new (maybe just abstract) data type. This seems natural in the=20 > > context of abstract data types with non-canonical=20 > representation, giving > > a kind of quotient type.=20 > [snip] > > Any opinions? >=20 > I support this suggestion. The standard equality/ordering/hashing > functions are often adequate for most of the data structures,=20 > and it would > be useful to use them and just place a hook on specific types=20 > to provide > specialized implementation. It could almost be done with > the "custom" block tag; the problem is that such blocks are=20 > not garbage > collected. What about "custom Caml blocks" ? I support the suggestion too. In general I'm not a big fan of types carrying much implicit functionality, but I like the "balance" that Caml has struck by making hashing, equality, ordering and marshalling available for all types. And given that you can define these functions for custom blocks, it cetainly makes sense to be able to define them for types defined in Caml as well... Cheers, Don ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr