From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 92EF881799 for ; Thu, 1 Aug 2013 17:00:22 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=mailfrom; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.web.de) identity=helo; client-ip=212.227.17.11; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvUBAAh3+lHU4xELm2dsb2JhbABbgzu5aIUugRwWDgEBAQEBBgsLCRQogiQBAQUnE08LGAklDwUoiDEBFrBDH4kWkA4WgwNzA5degSuEZ45T X-IPAS-Result: AvUBAAh3+lHU4xELm2dsb2JhbABbgzu5aIUugRwWDgEBAQEBBgsLCRQogiQBAQUnE08LGAklDwUoiDEBFrBDH4kWkA4WgwNzA5degSuEZ45T X-IronPort-AV: E=Sophos;i="4.89,795,1367964000"; d="scan'208";a="28201798" Received: from mout.web.de ([212.227.17.11]) by mail2-smtp-roc.national.inria.fr with ESMTP; 01 Aug 2013 17:00:21 +0200 Received: from frosties.localnet ([95.208.119.3]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0Mh7qL-1Uj6G41iqH-00MOyp for ; Thu, 01 Aug 2013 17:00:21 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.80) (envelope-from ) id 1V4uMW-0002T2-UG for caml-list@inria.fr; Thu, 01 Aug 2013 17:00:20 +0200 Date: Thu, 1 Aug 2013 17:00:20 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20130801150020.GB8825@frosties> References: <20130728001315.GA6534@frosties> <87txjdiq62.fsf@kingston.cl.cam.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87txjdiq62.fsf@kingston.cl.cam.ac.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:/FcIm5g1y+OJT98IO236YddYFo9rWFN47T1kX6NDEv42WFWdLFp Vbhr1mc3yQ1MmOzlGO6zhhPbBAXy1TkmvyEWd2jEYNrNJ+KrgQZv+w7CzfeTJQSLoWXLi/P Pl/3c3PKnm9JRMR57yDTWYcNH40cG5oK7v8CoVgzhl7jH16iGhWb9T96SZYOgRidWFRtk9q NyNaHkFfYshsVi1rPLOjg== Subject: Re: [Caml-list] Problems building a library, types go missing On Mon, Jul 29, 2013 at 12:03:33PM +0100, Leo White wrote: > > If you look at the interfaces for works.ml and fails.ml (using "ocamlc > -i"), you can see the problem: > > works.ml: > > module Foo : sig module T : sig type t = int val foo : t -> unit end end > module Functor : > sig > module type Foo_t = sig type t val foo : t -> unit end > module Make : functor (Foo : Foo_t) -> sig val do_foo : Foo.t -> unit end > end > > fails.ml: > > module Foo : sig module T : sig type t = int val foo : t -> unit end end > module Foo_t : sig module type T_t = sig type t val foo : t -> unit end end > module Functor : > sig > module Make : > functor (Foo : IntFoo_t.T_t) -> sig val do_foo : Foo.t -> unit end > end > > As you can see the Fails.Functor.Make functor expects an argument with > module type IntFoo_t.T_t, while the Works.Functor.Make functor expects > an argument with module type Works.Functor.Foo_t. > > Since you hide IntFoo_t when compiling your tests, the compiler cannot > find IntFoo_t.T_t and so it cannot check whether Fails.Functor.Make is > being applied correctly. > > To fix this simply add a signature to Fails.Functor, or better yet add a > "fails.mli" to your project: > > module Foo : sig module T : sig type t = int val foo : t -> unit end end > module Foo_t : sig module type T_t = sig type t val foo : t -> unit end end > module Functor : > sig > module Make : > functor (Foo : Foo_t.T_t) -> sig val do_foo : Foo.t -> unit end > end > > Regards, > > Leo Can I use some "with type" syntax instead? Something like module Functor = (IntFails with type IntFoo_t.T_t = Foo_t.T_t) I'm trying to keep the files short and few so I don't have to edit multiple files every time I change something. At least till the API stabilizes. MfG Goswin