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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 6DBB67EE11 for ; Thu, 21 Aug 2014 03:20:04 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jfc@mit.edu) identity=pra; client-ip=18.9.25.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jfc@mit.edu"; x-sender="jfc@mit.edu"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jfc@mit.edu designates 18.9.25.12 as permitted sender) identity=mailfrom; client-ip=18.9.25.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jfc@mit.edu"; x-sender="jfc@mit.edu"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@dmz-mailsec-scanner-1.mit.edu) identity=helo; client-ip=18.9.25.12; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jfc@mit.edu"; x-sender="postmaster@dmz-mailsec-scanner-1.mit.edu"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwBABBJ9VMSCRkMm2dsb2JhbABag2BXzE6HWQGBDRYQAQEBAQEICQsJFCmEBAEEASdEDhALRjwbBi6IHwgDCr4VhEkTBBiPATMHhEwBBJElhCaGeZkDUAGCTgEBAQ X-IPAS-Result: ApwBABBJ9VMSCRkMm2dsb2JhbABag2BXzE6HWQGBDRYQAQEBAQEICQsJFCmEBAEEASdEDhALRjwbBi6IHwgDCr4VhEkTBBiPATMHhEwBBJElhCaGeZkDUAGCTgEBAQ X-IronPort-AV: E=Sophos;i="5.01,905,1400018400"; d="scan'208";a="75493770" Received: from dmz-mailsec-scanner-1.mit.edu ([18.9.25.12]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Aug 2014 03:19:34 +0200 X-AuditID: 1209190c-f795e6d000006c66-b8-53f549237441 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 82.BA.27750.32945F35; Wed, 20 Aug 2014 21:19:31 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s7L1JVA8004482; Wed, 20 Aug 2014 21:19:31 -0400 Received: from atropos (pool-108-20-186-221.bstnma.fios.verizon.net [108.20.186.221]) (authenticated bits=0) (User authenticated as jfc@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s7L1JTqx005818 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 20 Aug 2014 21:19:30 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <21493.18720.441084.32472@gargle.gargle.HOWL> Date: Wed, 20 Aug 2014 21:19:28 -0400 From: "John F. Carr" To: Dario Teixeira Cc: OCaml mailing-list In-Reply-To: <1408559896.43780.YahooMailNeo@web121705.mail.ne1.yahoo.com> References: <1408559896.43780.YahooMailNeo@web121705.mail.ne1.yahoo.com> X-Mailer: VM 8.1.2 under 24.3.1 (amd64-portbld-freebsd10.0) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleLIzCtJLcpLzFFi42IR4hTV1lX2/BpssPGyqcWnHRtYLCa/eMDk wOQx6cUhFo9Zsw4zBTBFcdmkpOZklqUW6dslcGXcvLKCreAtV8XpCUuZGhjvcXQxcnBICJhI tE4M7GLkBDLFJC7cW8/WxcjFISQwm0li7r277BDORkaJ1V1vmSGcY0wSPyffYQdp4RUQlDg5 8wkLiM0soCOxc+sdNghbW2LZwtfMEDWWEqtnL2cF2cYioCrxZ2EpSJhNQEni05pZYK0iQK3/ 2o+yw7SueXSdCaRcWMBZ4sstVRCTU8BT4vGUBJAKIQEPiYa+CWwQN1tLLNnynnkCo+AsJPfM QnLPLCT3LGBkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrqJebWaKXmlK6iREcupI8OxjfHFQ6 xCjAwajEw3tj0ZdgIdbEsuLK3EOMkhxMSqK8agZfg4X4kvJTKjMSizPii0pzUosPMUpwMCuJ 8Lr+AirnTUmsrEotyodJSXOwKInzvrW2ChYSSE8sSc1OTS1ILYLJ6nJwCCybttFC4Nyeu8cY pVjy8vNSlSR4T7sDbREsSk1PrUjLzClBqGfi4ATZxgO0bRpIDW9xQWJucWY6RP4Uo6KUOO9t kIQASCKjNA+uF5Z8XjGKA/0mzHsFpIoHmLjgul8BDWYCGrx18UeQwSWJCCmpBkb3d+WP1Z94 L7JKnXZn7Q8Pu6cK3eya080753XsP9y4fe4Phrpi07I/lQ4R67Mn7fiRufRE6eOvbf9viR78 /K5A1CVLvP0d1xmmgzEmDbXzTxQuyVyYu72c7QvfmamW7FmTHv8WUG4VCj7JVyirmjbr88u8 5VuWGKQ/dWKWSXmtfDUgf7LArmQlluKMREMt5qLiRAARkJYaGQMAAA== Subject: Re: [Caml-list] Locally abstract type with type parameters I hit the same limitation last year: https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00159.html The inability to constrain parameterized types in packed module types is a documented restriction. You will have to ask the type theory experts whether it is a necessary restriction. A followup message offered a workaround for some cases. https://sympa.inria.fr/sympa/arc/caml-list/2013-04/msg00160.html > To avoid type-escaping-its-scope errors, we need to define a locally abs= tract > type in the implementation of 'actually_process'.=A0 Something like this: >=20 > =A0 let actually_process (type u) (module Logger: LOGGER with type 'a Mo= nad.t =3D 'a u) x =3D > =A0=A0=A0=A0=A0 let open Logger in > =A0=A0=A0=A0=A0 let (>>=3D) t f =3D Monad.bind t f in > =A0=A0=A0=A0=A0 Logger.log () >>=3D fun () -> > =A0=A0=A0=A0=A0 Monad.return x >=20 >=20 > Which does not actually compile.=A0 Is it at all possible to use a local= ly > abstract type when that type has type parameters?=A0 And is there a solu= tion > to this problem that does not require a) moving the implementation of > 'actually_process' to the inside of a functor, or b) pass each function > of the first-class module as a separate parameter to 'actually_process'? >=20 > Thanks in advance for your time! > Best regards, > Dario Teixeira