From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA17660 for caml-redistribution@pauillac.inria.fr; Fri, 10 Mar 2000 09:03:30 +0100 (MET) Resent-Message-Id: <200003100803.JAA17660@pauillac.inria.fr> 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 XAA08014 for ; Wed, 8 Mar 2000 23:29:36 +0100 (MET) Received: from miss.wu-wien.ac.at (miss.wu-wien.ac.at [137.208.107.17]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id XAA17362 for ; Wed, 8 Mar 2000 23:29:35 +0100 (MET) Received: (from mottl@localhost) by miss.wu-wien.ac.at (8.9.0/8.9.0) id XAA14210; Wed, 8 Mar 2000 23:29:31 +0100 (MET) From: Markus Mottl Message-Id: <200003082229.XAA14210@miss.wu-wien.ac.at> Subject: Re: additions to standard library? To: filliatr@csl.sri.com Date: Wed, 8 Mar 2000 23:29:30 +0100 (MET) Cc: caml-list@inria.fr (OCAML) In-Reply-To: <14534.41960.928650.590869@cylinder.csl.sri.com> from "Jean-Christophe Filliatre" at Mar 08, 2000 11:03:04 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-From: weis@pauillac.inria.fr Resent-Date: Fri, 10 Mar 2000 09:03:30 +0100 Resent-To: caml-redistribution@pauillac.inria.fr > But when using functorial interfaces like Set.Make, you have to > redefine these functions for each application of the functor. Thus, > you really need these functions to be defined in the functor i.e. > together with the datatype (and, by the way, you can then define these > functions a bit more efficiently---without using exceptions). Exactly - this raises another question which has been bothering me from time to time when using the module system: How can you extend the functionality of a module without having to "copy" the definitions of the underlying module "by hand"? In a case which I found particularly ugly (in the "res"-library), I had to "copy" nearly 100 lines as in: module Foo = struct module B = ... type t = B.t ... let iter = B.iter let iteri = B.iteri let map = B.map let mapi = B.mapi ... end Everytime the other module gets extended, I have to add code by hand here, too, to make it available. I do not see any simple workaround for this. Extending standard libraries with needed functionality would be much easier if there were a convenient way to get around the problem above. Regards, Markus Mottl -- Markus Mottl, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl