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 GAA22629; Tue, 11 Nov 2003 06:34:02 +0100 (MET) 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 GAA23035 for ; Tue, 11 Nov 2003 06:34:01 +0100 (MET) Received: from cs.uoregon.edu (vitalstatistix.cs.uoregon.edu [128.223.4.19]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAB5Xr116265 for ; Tue, 11 Nov 2003 06:33:55 +0100 (MET) Received: from cs.uoregon.edu (cisco-ts6-line112.uoregon.edu [128.223.209.172]) by cs.uoregon.edu (8.12.10/8.12.10) with ESMTP id hAB5XNP3024479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 10 Nov 2003 21:33:50 -0800 (PST) Message-ID: <3FB0749C.80103@cs.uoregon.edu> Date: Mon, 10 Nov 2003 21:33:16 -0800 From: Chris GauthierDickey User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031105 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] type issues with modules Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; mli:01 val:01 mli:01 val:01 ocamlc:01 ocamlc:01 chris:01 chris:01 interfaces:01 match:02 match:02 compile:02 modules:02 modules:02 unbound:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I have a weird issue, but I'm not sure if it's related to the type system or what's really going on. I've boiled the problem down to the simple case below. I have 4 files, two that are interfaces for the modules. file: mod1.mli type t1 = T1 val v: t1 file mod1.ml type t1 = T1 let v = Mod2.f2 () file mod2.mli val f2: unit -> Mod1.t1 file mod2.ml let f2 () = Mod1.T1 I compile the files as such: ocamlc -g mod1.mli ocamlc -g mod2.mli ocamlc -g mod1.ml at which point I get the error: The implementation mod1.ml does not match the interface mod1.cmi: Values do not match: val v : Mod1.t1 is not included in val v: t1 which seems a little odd since t1 is certainly contained in Mod1.t1. I feel like the types at this point are known, defined in the interface file and that we know that the types in the ml file belong to the same module as the interface. Am I wrong? If I had the type expressions and change mod1.ml to: type t1 = T1 let v:(Mod1.t1) and then mod1.mli to type t1 = T1 let v:(Mod1.t1) I get the error: Unbound type constructor Mod1.t1, which makes some sense. But again I'd argue that at this point, we know the name of the module, so Mod1.t1 is the same thing as t1. Maybe I'm totally missing something obvious? Thanks in advance, Chris P.S. I know I can move t1 into another module, but for software engineering reasons, I don't want to do that. ------------------- 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