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 NAA16745; Thu, 19 Apr 2001 13:41:36 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA16749 for caml-list@pauillac.inria.fr; Thu, 19 Apr 2001 13:41:35 +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 VAA07894 for ; Wed, 18 Apr 2001 21:42:26 +0200 (MET DST) Received: from clio.sc.intel.com (scfdns01.sc.intel.com [143.183.152.25]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f3IJgOf19579 for ; Wed, 18 Apr 2001 21:42:25 +0200 (MET DST) Received: from ichips-ra.pdx.intel.com (ichips-ra-hme3.intel.com [10.7.7.35]) by clio.sc.intel.com (8.9.1a+p1/8.9.1/d: relay.m4,v 1.36 2001/04/18 16:16:02 root Exp $) with ESMTP id TAA24322 for ; Wed, 18 Apr 2001 19:42:18 GMT Received: from dhpc0010.pdx.intel.com (dhpc0010.pdx.intel.com [10.7.21.33]) by ichips-ra.pdx.intel.com (8.9.1a/8.9.1/d: internal.m4,v 1.2 1998/11/09 19:18:37 iwep Exp iwep $) with ESMTP id MAA08259; Wed, 18 Apr 2001 12:42:17 -0700 (PDT) Received: from ichips.intel.com (johnh@localhost [127.0.0.1]) by dhpc0010.pdx.intel.com (8.9.1a/8.9.1/d: client-ra.m4,v 1.1 1998/12/24 19:00:55 jamesw Exp jamesw $) with ESMTP id MAA05265; Wed, 18 Apr 2001 12:42:17 -0700 (PDT) Message-Id: <200104181942.MAA05265@dhpc0010.pdx.intel.com> To: caml-list@inria.fr cc: John Harrison Subject: [Caml-list] User-defined equality on types? Date: Wed, 18 Apr 2001 12:42:16 -0700 From: John R Harrison Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'd like to suggest allowing the user to define a chosen interpretation of the equality symbol, and perhaps the polymorphic orderings too, on each new (maybe just abstract) data type. This seems natural in the context of abstract data types with non-canonical representation, giving a kind of quotient type. Has this ever been considered? Are there good reasons against it? Of course, I'd be happy for behaviour to be undefined if the user nominates, say, a non-reflexive or non-substitutive "equality" relation. At present, I find that it's often quite inconvenient to use complicated structures involving abstract types. In particular, I use the type of arbitrary-precision numbers a lot, and frequently end up having to define variants of standard polymorphic operations like set union for several different types involving ":num". This would be avoided if I could just automatically interpret "=" on the type ":num" as the special comparison operator "=/". Any opinions? John. ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr