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 WAA03863; Fri, 8 Feb 2002 22:21:21 +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 WAA04739 for ; Fri, 8 Feb 2002 22:21:20 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g18LLJr16540 for ; Fri, 8 Feb 2002 22:21:20 +0100 (MET) Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id g18LLJp68448 ; Fri, 8 Feb 2002 22:21:19 +0100 (CET) Received: from localhost (frisch@localhost) by clipper.ens.fr (8.9.2/jb-1.1) id WAA19239 ; Fri, 8 Feb 2002 22:21:19 +0100 (MET) Date: Fri, 8 Feb 2002 22:21:19 +0100 (MET) From: Alain Frisch To: Charles Martin cc: Subject: Re: [Caml-list] exposing module types In-Reply-To: <5.1.0.14.0.20020208125014.02a31630@192.168.0.1> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 8 Feb 2002, Charles Martin wrote: > I obviously have the wrong model of what's going on here: > > % cat foolib.ml > module Foo = struct > module type INTF = sig > type 'a fruit = Apple of 'a > end > module Impl : INTF = struct > type 'a fruit = Apple of 'a > end > type 'a fruit = 'a Impl.fruit > end > include Foo > % ocamlc -a -o foolib.cma foolib.ml > What am I doing wrong? The line "type 'a fruit = 'a Impl.fruit" just asserts that the type 'a fruit is the same as 'a Impl.fruit. It does not say what its value constructors are, though this could be deduced. The solution is to replace the line with: type 'a fruit = 'a Impl.fruit = Apple of 'a (or: include Impl, but that is probably not what you want to do) -- Alain ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr