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 9B59F7EE51 for ; Thu, 18 Apr 2013 22:11:12 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of markus.mottl@gmail.com) identity=pra; client-ip=209.85.223.181; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of markus.mottl@gmail.com designates 209.85.223.181 as permitted sender) identity=mailfrom; client-ip=209.85.223.181; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f181.google.com) identity=helo; client-ip=209.85.223.181; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="postmaster@mail-ie0-f181.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAMBScFHRVd+1m2dsb2JhbABQDoMuwFt+CBYOAQEBAQEGCwsJFCiCHwEBBUABFAcdAQMMBgULAwouIQEBEQEFARwGEwiHeQEDD59PjC+Ce4R7ChknDVmIfgEFDIw5glMHg0cDlSSBY4t4gzoWKYNvWyA X-IPAS-Result: AhYCAMBScFHRVd+1m2dsb2JhbABQDoMuwFt+CBYOAQEBAQEGCwsJFCiCHwEBBUABFAcdAQMMBgULAwouIQEBEQEFARwGEwiHeQEDD59PjC+Ce4R7ChknDVmIfgEFDIw5glMHg0cDlSSBY4t4gzoWKYNvWyA X-IronPort-AV: E=Sophos;i="4.87,503,1363129200"; d="scan'208";a="13926908" Received: from mail-ie0-f181.google.com ([209.85.223.181]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Apr 2013 22:11:11 +0200 Received: by mail-ie0-f181.google.com with SMTP id tp5so1401705ieb.26 for ; Thu, 18 Apr 2013 13:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=50DESPwCwF3w5UMxfznOlcZao3obCgpAJKU62lv8HbY=; b=RjogOK7YBbBPfXKIFgitOXJNJQWfLJ2gDX8bTzW1oEIWRH8UKOLkYzwUgSYrF8TDsz sIqJSe1KJyi9JI/uwDGcD9qKKnH4lgkVcIWvZBL5scUSZSldDlWfX/lLwGunYlHv1qU5 U7OigG/YBhCzIJYKPj/IY6Sf1om+ekrR2CYgeQQccDrjk7ARYT6L6xg5px0Eg+hvc6TX v5PS5rZ3tAEStX7Y4D7e87aa07v0RwByXFUGz85ZQ6RFJmG/dpXbghLlLvkeYgQcH61L zcXSm9ZM662zu6HtdGVbHgOsxlBmS33oC6lpQ0j2b0yonQSjPz6LQaFvFDvoE/A55dvZ QB1A== MIME-Version: 1.0 X-Received: by 10.50.138.166 with SMTP id qr6mr13683136igb.45.1366315870687; Thu, 18 Apr 2013 13:11:10 -0700 (PDT) Received: by 10.64.32.34 with HTTP; Thu, 18 Apr 2013 13:11:10 -0700 (PDT) In-Reply-To: <201304181712.r3IHCbSC023593@outgoing.mit.edu> References: <201304181712.r3IHCbSC023593@outgoing.mit.edu> Date: Thu, 18 Apr 2013 16:11:10 -0400 Message-ID: From: Markus Mottl To: John Carr Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Unpacked module parameterized type escaping On Thu, Apr 18, 2013 at 1:12 PM, John Carr wrote: > > I have a function of two arguments: > > 1. A packed module implementing Map.S. > > 2. A value of the module's Map.S.t. > > I can't find a way to prevent a "type constructor ... would escape its > scope" error. I think you may just want to wrap both the map module to be used and the value on which its functions should operate in another first-class module, e.g.: module type Arg = sig module M : Map.S with type key = int val v : 'a M.t end Then you can write: let is_empty (module Arg : Arg) = Arg.M.is_empty Arg.v This admittedly doesn't look particularly elegant, but should solve the problem. Regards, Markus -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com