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 680B3820A1 for ; Mon, 12 Aug 2013 14:25:17 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of kerneis@pps.univ-paris-diderot.fr) identity=pra; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="kerneis@pps.univ-paris-diderot.fr"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel@kerneis.info designates 176.31.113.173 as permitted sender) identity=mailfrom; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="gabriel@kerneis.info"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@wanbli.kerneis.info designates 176.31.113.173 as permitted sender) identity=helo; client-ip=176.31.113.173; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel@kerneis.info"; x-sender="postmaster@wanbli.kerneis.info"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlcFAHHTCFKwH3Gt/2dsb2JhbABagwY1gxy9IhZ0giQBAQQBOgYBATcBBAsLGAklDwVJiB0GBAijdoRHAQWNNAIEk112l2aGHYs1gxw X-IPAS-Result: AlcFAHHTCFKwH3Gt/2dsb2JhbABagwY1gxy9IhZ0giQBAQQBOgYBATcBBAsLGAklDwVJiB0GBAijdoRHAQWNNAIEk112l2aGHYs1gxw X-IronPort-AV: E=Sophos;i="4.89,862,1367964000"; d="scan'208";a="29137701" Received: from wanbli.kerneis.info ([176.31.113.173]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 12 Aug 2013 14:25:16 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kerneis.info; s=wanbli-rsa1; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=itu+JGYQ2gfcdDn5k0wLckWTv4TFHOyeg1RVG2zoAeI=; b=J7hKNvEhqI9eMEYB8449tTwOqkSx748RQH42gn5vGCYB4UbQhk1uk8e2LRlkfNKkLo4RUNW4ZZdTsaTv7jx9HEgTefvvavJC0H1eTP29DbWFhKrNQTVWoqqlUa89TVskN3hvQ1HmaGWKElgTlj7HUdJhB9LDzJ8I69jmqA4WGfg=; Received: from wowasieco.sm.cl.cam.ac.uk ([128.232.60.22] helo=localhost) by wanbli.kerneis.info with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1V8rBT-0005fe-Ew; Mon, 12 Aug 2013 12:25:15 +0000 Date: Mon, 12 Aug 2013 13:25:13 +0100 From: Gabriel Kerneis To: Jeremy Yallop Cc: caml-list@yquem.inria.fr, markus.mottl@gmail.com Message-ID: <20130812122513.GA4129@kerneis.info> References: <20130812074545.GA4646@kerneis.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: 128.232.60.22 X-SA-Exim-Mail-From: gabriel@kerneis.info X-SA-Exim-Scanned: No (on wanbli.kerneis.info); SAEximRunCond expanded to false X-Validation-by: kerneis@pps.univ-paris-diderot.fr Subject: Re: [Caml-list] Signature substitution and type parameters On Mon, Aug 12, 2013 at 11:20:17AM +0100, Jeremy Yallop wrote: > If you use 'include' instead of 'let' it generalizes nicely to the > many-function case: > > module MonoM : Mono = struct > type t = int PolyM.t > include (PolyM : Mono with type t := t) > end Ha! I tried it written as "include PolyM with ...", which is invalid syntax, and didn't get any further. Thanks Jeremy. > Your other approach can be made to work, too. The key is to define a > type alias with no parameters (type t = int PolyM.t), then use > destructive substitution (:=). By the way, there is an unanswered question from June by Markus Mottl about the root causes of this limitation: https://sympa.inria.fr/sympa/arc/caml-list/2013-06/msg00147.html Maybe you can shed some light on it? Best regards, -- Gabriel