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 CAA27577; Thu, 14 Oct 2004 02:21:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA27694 for ; Thu, 14 Oct 2004 02:21:15 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i9E0LDIn015516 for ; Thu, 14 Oct 2004 02:21:14 +0200 Received: from [192.168.1.200] (ppp202-150.lns1.syd3.internode.on.net [203.122.202.150]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i9E0L74Y078566; Thu, 14 Oct 2004 09:51:08 +0930 (CST) Subject: Re: [Caml-list] My wishlist: DRY modules From: skaller Reply-To: skaller@users.sourceforge.net To: brogoff Cc: Brian Hurt , Ocaml Mailing List In-Reply-To: References: Content-Type: text/plain Message-Id: <1097713265.2581.41.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 14 Oct 2004 10:21:07 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 416DC679.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 wishlist:01 sourceforge:01 2004:99 brogoff:01 annoyances:01 foo:01 foo:01 mli:01 sigs:01 sigs:01 functor:01 intset:01 struct:01 intset:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 2004-10-14 at 09:09, brogoff wrote: > 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. But can you do that with functor instances? When I write something like: module IntSet = Set.Make(struct type t = int end) but type of IntSet is be spelled out long hand in the mli file. This is far worse than merely reflecting the interface of a module you wrote by hand -- it also breaks with upgrades to the library :( Of course I can use ocamlc -i, but then I can't apply any constraints. I'd like to be able to instantiate a functor type too. Can this be done? -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net ------------------- 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