From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 30CC0BC57 for ; Tue, 25 May 2010 15:24:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsUDAMds+0vZSMDqe2dsb2JhbACeARUBARYiAx+/CIUTBA X-IronPort-AV: E=Sophos;i="4.53,298,1272837600"; d="scan'208";a="51178143" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 May 2010 15:23:59 +0200 Received: from smtp01.web.de ( [172.20.0.243]) by fmmailgate03.web.de (Postfix) with ESMTP id C1806152467EC; Tue, 25 May 2010 15:23:58 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp01.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OGu6w-0006fR-00; Tue, 25 May 2010 15:23:58 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.71) (envelope-from ) id 1OGu6w-0001a0-0a; Tue, 25 May 2010 15:23:58 +0200 From: Goswin von Brederlow To: Julien Signoles Cc: Goswin von Brederlow , caml-list@inria.fr Subject: Re: [Caml-list] RFH: Values do not match: val bar1 : Foo.foo_t is not included in val bar1 : Foo.foo_t References: <87632el1ii.fsf@frosties.localdomain> Date: Tue, 25 May 2010 15:23:57 +0200 In-Reply-To: (Julien Signoles's message of "Tue, 25 May 2010 10:28:59 +0200") Message-ID: <87vdact8r6.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX18Nk19c+DSXdo2WPbQKWi/bF3IjLE+fB2fEPzAz LvEM7hpaPSE3hUi2s108yGBlE7YRs5BvXbrzt0W3crd16s/J1M 6IdN2SV1o= X-Spam: no; 0.00; val:01 foo:01 foo:01 val:01 signoles:01 signoles:01 cmx:01 mli:01 sig:01 extern:01 sig:01 intern:01 generative:01 mli:01 dfb:01 Julien Signoles writes: > Hello, > > 2010/5/24 Goswin von Brederlow > > I'm playing around with packs and ways to avoid having to duplicate > module signatures all over the place. So I came up with the following > idea: Each module declares an external and internal module type and > restricts itself to the internal type. The pack then further restricts > the module to the external type. > > But then I get a type error I can't make heads or tails of:  > > > File "pack.cmx", line 1, characters 0-1: > Error: The implementation (obtained by packing) >       does not match the interface pack.mli: >       Modules do not match: >         sig >           module type Extern = sig val bar1 : Foo.foo_t end >           module type Intern = >             sig val bar1 : Foo.foo_t val bar2 : Foo.foo_t end >           module I : sig val bar1 : Foo.foo_t val bar2 : Foo.foo_t end >           val bar1 : Foo.foo_t >           val bar2 : Foo.foo_t >         end >       is not included in >         sig val bar1 : Foo.foo_t end >       Values do not match: >         val bar1 : Foo.foo_t >       is not included in >         val bar1 : Foo.foo_t > make: *** [all] Error 2  > > > > Can anyone explain that to me? > > > The error message is not very helpful here. But don't refer to an internal > generative type (namely Foo.foo_t) in your packing signature pack.mli. To solve > your issue, you have to declare the type foo_t outside the pack like I said in > a previous message (http://caml.inria.fr/pub/ml-archives/caml-list/2010/05/ > b79d812d9dfb99e12c8e924f83d7168c.en.html). > > Hope this helps, > Julien That sounds like a bug then. I was trying hard not to repeat information in different places. That just ends up with one of them getting out of sync. MfG Goswin