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 UAA05206; Thu, 3 Jun 2004 20:33:43 +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 UAA05202 for ; Thu, 3 Jun 2004 20:33:42 +0200 (MET DST) Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i53IXfSH008311 for ; Thu, 3 Jun 2004 20:33:42 +0200 Received: from melbourne-city-street.mit.edu (MELBOURNE-CITY-STREET.MIT.EDU [18.7.21.86]) by biscayne-one-station.mit.edu (8.12.4/8.9.2) with ESMTP id i53IXeRP010226 for ; Thu, 3 Jun 2004 14:33:41 -0400 (EDT) Received: from psi-phi.mit.edu (PSI-PHI.MIT.EDU [18.187.1.35]) (authenticated bits=56) (User authenticated as jfc@ATHENA.MIT.EDU) by melbourne-city-street.mit.edu (8.12.4/8.12.4) with ESMTP id i53IXeOm009084 for ; Thu, 3 Jun 2004 14:33:40 -0400 (EDT) Received: (from jfc@localhost) by psi-phi.mit.edu (8.12.9) id i53IXe5a023254; Thu, 3 Jun 2004 14:33:40 -0400 Message-Id: <200406031833.i53IXe5a023254@psi-phi.mit.edu> To: Caml List Subject: Re: [Caml-list] module types In-Reply-To: Your message of "Thu, 03 Jun 2004 19:26:19 +0200." <20040603192619.2a50e1f5@mostha> Date: Thu, 03 Jun 2004 14:33:40 -0400 From: John Carr X-Miltered: at concorde with ID 40BF6F05.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 jfc:01 val:01 intentional:01 compiler:01 sig:01 sig:01 int:01 declaring:01 module:03 module:03 unnamed:96 string:03 constructor:03 suppose:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I also have a problem with module types. Suppose I have module type T = sig type t val f : t -> string end If I want to declare a module implementing this signature I can write module X : T with type t = int but this similar declaration is not allowed module Y : T with type t = A | B | C The manual implies this restriction is intentional, a result of not allowing unnamed constructor types. I also tried module Y : sig include T type t = A | B | C end but the compiler considered this to be an illegal duplicate definition of type t. 1. Is there a reason not to allow (A | B | C) as an anonymous type declaration? 2. Is there a way to do what I want without declaring the type name outside the module? I prefer to limit the scope of type names. ------------------- 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