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 RAA09299; Mon, 16 Jun 2003 17:08:04 +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 RAA09058 for ; Mon, 16 Jun 2003 17:08:03 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h5GF82H08329; Mon, 16 Jun 2003 17:08:02 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA09862; Mon, 16 Jun 2003 17:08:01 +0200 (MET DST) Date: Mon, 16 Jun 2003 17:08:01 +0200 From: Xavier Leroy To: efiliot@ens-lyon.fr Cc: caml-list@inria.fr Subject: Re: [Caml-list] module type and record Message-ID: <20030616170801.B9308@pauillac.inria.fr> References: <65D56CA3-9FDA-11D7-813D-000A95764898@ens-lyon.fr> <1055757571.3eed95032132f@mouette.ens-lyon.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <1055757571.3eed95032132f@mouette.ens-lyon.fr>; from efiliot@ens-lyon.fr on Mon, Jun 16, 2003 at 11:59:31AM +0200 X-Spam: no; 0.00; caml-list:01 struct:01 modtype:01 compiler:01 sig:01 int:01 rec:01 module:03 string:03 seems:05 separately:05 artificial:05 somewhat:06 construct:06 type:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > hello, > I need to declare a record type in a field like : > > module A : ( MY_TYPE with type t = { label1 : int ; label2 : string } ) = > struct > .... > end > > but the compiler seems to refuse this declaration. Currently, only type abbreviations can be added with the "with type" construct: MODTYPE with type t = some_type_expression. This restriction is somewhat artificial and I'm considering lifting it. > Could you give me a solution for this problem ? Currently, you need to expand "MY_TYPE with..." by hand into sig type t = { label1 : int ; label2 : string } (* other elements of signature MY_TYPE end An alternative is to declare the record type separately: type my_rec = { label1 : int ; label2 : string } module A : (MY_TYPE with type t = my_rec) = ... - Xavier Leroy ------------------- 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