From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 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 A2B9FBBAF for ; Wed, 9 Sep 2009 21:40:26 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjYBAOehp0rRVdOwkGdsb2JhbACSBYh8PwEBAQEJCQwHEwOxZoEnkFoBAwIEhBQF X-IronPort-AV: E=Sophos;i="4.44,359,1249250400"; d="scan'208";a="33978587" Received: from mail-yw0-f176.google.com ([209.85.211.176]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Sep 2009 21:40:26 +0200 Received: by ywh6 with SMTP id 6so2066766ywh.0 for ; Wed, 09 Sep 2009 12:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=ii/8fWVALCVtj3VL2VHfKQCWYaKoUzPR+ab9Ab/60wM=; b=ejmVTWSiVyvGt4l26f3/4ETvDtMC8ZBu8BLyOzqlYiMGvQ5yDrhLZ0U3nYI8SqpYJH pUOqjMMXrrnRvrkDdxngBXLARXqTz7N4ymYaOLOBfG4Hmi7i98rP2Ec6cV/0WZMdc+9y Ivq1yvdzD/6fwfzrAnNwPK2f7qffjUbasi8pg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=SylBYCfIJEQdGibovuU6XCGuCuiEvEyMYydHD6UxE9YXTQcEh0Zap8afcTTz+r5y2M uOjOsJ/c+JPstq4OLUJ1QReE6C29WqoLzm3X6id66wqv2p8IhuAsMbc+ENctIdJaL0el zdLjCBuKlqxI7EuDQKYUVvDnpPWv36/7aR5AQ= MIME-Version: 1.0 Received: by 10.101.62.6 with SMTP id p6mr640164ank.153.1252525225043; Wed, 09 Sep 2009 12:40:25 -0700 (PDT) In-Reply-To: <4b39c80a0909091200v7ae57950q4775d4b4ed4a51b3@mail.gmail.com> References: <4b39c80a0909091200v7ae57950q4775d4b4ed4a51b3@mail.gmail.com> Date: Wed, 9 Sep 2009 21:40:25 +0200 Message-ID: <527cf6bc0909091240u3aa0bb40u3186457a33c0636c@mail.gmail.com> Subject: Re: [Caml-list] Partially hiding modules in packages From: blue storm To: Alexey Rodriguez Cc: OCaml List Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; foo:01 mli:01 syntax:01 foo:01 sig:01 val:01 val:01 indirection:01 -pack:01 foobar:01 foobar:01 mli:01 storm:98 caml-list:01 partially:02 The problem with your packages.tgz example is that you use "module type Foo = .." in the .mli. This gives the signature of a module type, that is, it refers to a _module type_ defined in the implementation file. What you want to do here is to give the signature of a _module_, not a module types, so here is the correct syntax : module Foo : sig type foo_t val initial : foo_t val show : foo_t -> string end Regarding your original problem, I've had the same needs and came up with a slightly different solution : in order to avoid the additional indirection level related to -pack (Foobar.Foo), is used a flattened representation by adding a "foobar.ml" file containing only : include Foo (and possibly include of other modules in the package). Then the foobarl.mli is : type foo_t val initial : foo_t val show : foo_t -> string And values can be referred with Foobar.foo, instead of Foobar.Foo.foo. Of course this is only useful if you don't want the user to see the internal module hierarchy, wich may not be what you had in mind.