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 FAA30924; Thu, 14 Oct 2004 05:10:14 +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 FAA30490 for ; Thu, 14 Oct 2004 05:10:13 +0200 (MET DST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id i9E3AB47001159 for ; Thu, 14 Oct 2004 05:10:12 +0200 Received: from localhost (suiren.kurims.kyoto-u.ac.jp [130.54.16.25]) by kurims.kurims.kyoto-u.ac.jp (8.9.3p2-20030924/3.7W) with ESMTP id KAA10522; Thu, 14 Oct 2004 10:38:45 +0900 (JST) Date: Thu, 14 Oct 2004 10:38:38 +0900 (JST) Message-Id: <20041014.103838.28784105.garrigue@kurims.kyoto-u.ac.jp> To: skaller@users.sourceforge.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] My wishlist: DRY modules From: Jacques Garrigue In-Reply-To: <1097713265.2581.41.camel@pelican.wigram> References: <1097713265.2581.41.camel@pelican.wigram> X-Mailer: Mew version 4.0.64 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 416DEE13.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 jacques:01 sourceforge:01 functor:01 intset:01 struct:01 intset:01 spelled:99 mli:01 elt:01 mylist:01 mylist:01 mli:01 jacques:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: skaller > 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 :( In the interface, you just write: module IntSet : Set.S with elt = int So you see that as long as you have the right signature defined somewhere, your interfaces are going to be pretty short. My main grudge is that an interface is not a signature, so you cannot write things like: module MyList : List while you can create an interface from a signature (* myList.mli *) include ListSig Jacques Garrigue ------------------- 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