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=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id A5BF6BBC1 for ; Wed, 23 Apr 2008 16:16:58 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As8AALvhDkjC2fJVfGdsb2JhbACRUgEBCwUCBwcWm2o X-IronPort-AV: E=Sophos;i="4.25,699,1199660400"; d="scan'208";a="9960510" Received: from anchor-post-35.mail.demon.net ([194.217.242.85]) by mail2-smtp-roc.national.inria.fr with ESMTP; 23 Apr 2008 16:16:58 +0200 Received: from orion.metastack.com ([80.177.38.218]) by anchor-post-35.mail.demon.net with esmtp (Exim 4.67) id 1JofmL-000Li7-GW for caml-list@yquem.inria.fr; Wed, 23 Apr 2008 14:16:57 +0000 Received: from orion.metastack.com (IDENT:25@localhost [127.0.0.1]) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id m3NEEBUB024898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 23 Apr 2008 15:14:18 +0100 Received: (from defang@localhost) by orion.metastack.com (8.13.4/8.13.3/Submit) id m3NDsWnr024772 for ; Wed, 23 Apr 2008 14:54:32 +0100 X-Authentication-Warning: orion.metastack.com: defang set sender to using -f Received: from countertenor (general-kt-195.t-mobile.co.uk [149.254.192.195]) by orion.metastack.com (envelope-sender ) (MIMEDefang) with ESMTP id m3NDsUQx024768; Wed, 23 Apr 2008 14:54:32 +0100 (BST) From: "David Allsopp" To: "'Brian Hurt'" , "'Jon Harrop'" Cc: References: <480C60DF.9010000@exalead.com><480C739F.5080104@lri.fr> <200804231335.25708.jon@ffconsultancy.com> <480F38D7.4050503@janestcapital.com> Subject: RE: [Caml-list] Announce: xsetxmap, unfunctorized, Sexp-lib awareversions of Set and Map Date: Wed, 23 Apr 2008 14:56:47 +0100 Organization: MetaStack Solutions Ltd. Message-ID: <008b01c8a549$e6fa0600$017ca8c0@countertenor> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: AcilRTWPgodnJGjFQ1yP/iGi8OAblQAAkm9Q In-Reply-To: <480F38D7.4050503@janestcapital.com> X-Scanned-By: MIMEDefang 2.63 on 172.16.28.218 X-Spam: no; 0.00; integers:01 pervasives:01 stdlib:01 mli:01 struct:01 pervasives:01 elt:01 cmo:01 cmx:01 char:01 imho:01 wrote:01 wrote:01 ints:01 caml-list:01 Brian Hurt wrote: > Jon Harrop wrote: > > > Actually I would say that your style is more useful than the built-in > > Set and Map modules because you don't have to jump through hoops > > defining your own "Int" module with its own "int" type and its own > > comparison function over ints every time you want a set of integers. I > > would put the comparison function in the set itself though. > > > > > > > IMHO, the Int module should be in the standard library, and the Set and > Map modules should have already instantiated sets and maps for the > standard base types (int, float, string, char). Agreed - then we could also have more sensibly located functions such as Int.of_string (note that it's the same length as int_of_string!!) and remove lots of random functions from Pervasives! All that said, and especially as StdLib changes are reasonably rare, I find having files IntSet.ml and IntSet.mli containing: include Set.Make(struct type t = int let compare = Pervasives.compare end) and include Set.S with type elt = int isn't too bad (except that you have to include IntSet.cmo/.cmx when compiling, obviously) David