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 BAA25819; Thu, 14 Oct 2004 01:09:39 +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 BAA25806 for ; Thu, 14 Oct 2004 01:09:38 +0200 (MET DST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i9DN9aCh001674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 14 Oct 2004 01:09:38 +0200 Received: (qmail 31813 invoked from network); 13 Oct 2004 23:09:35 -0000 Received: from shell2.speakeasy.net ([69.17.110.71]) (envelope-sender ) by mail1.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 13 Oct 2004 23:09:35 -0000 Date: Wed, 13 Oct 2004 16:09:35 -0700 (PDT) From: brogoff To: Brian Hurt cc: Ocaml Mailing List Subject: Re: [Caml-list] My wishlist: DRY modules In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 416DB5B0.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brogoff:01 brogoff:01 caml-list:01 wishlist:01 annoyances:01 foo:01 foo:01 mli:01 sigs:01 sigs:01 mli:01 complained:01 violates:01 mls:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 13 Oct 2004, Brian Hurt wrote: > > I'm doing some work with modules, and I'm learning some of their > annoyances. Number one is having to repeat module type definitions. For > example, say you have a file foo. In foo.mli, you have: It's annoying, but in the case you describe, just put the signatures in their own separate file (sigs.ml or whatever), then you refer to them as Sigs.T, Sigs.S, etc., and you don't need to repeat them, or change them in more than one place as you develop. If you do it that way, the annoyance becomes pretty small. I think it would be very helpful if you could actually refer to the signature implied by a .mli file as a signature so as to use include. People have complained about this before, maybe we'll see it in a future OCaml. > I wish you didn't have to repeat the module definitions in the module > file *if* you have a .mli file. In the case you described, I don't think you have to. If you want to extend a module like List you need to copy the .mli, which is still an annoyance, and violates your DRY principle. Anyways, parameterized module systems like MLs are great. -- Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners