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 3FF437EE51 for ; Mon, 20 May 2013 16:13:52 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of carette@mcmaster.ca) identity=pra; client-ip=130.113.128.28; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="carette@mcmaster.ca"; x-sender="carette@mcmaster.ca"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of carette@mcmaster.ca) identity=mailfrom; client-ip=130.113.128.28; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="carette@mcmaster.ca"; x-sender="carette@mcmaster.ca"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@pinegw02.uts.mcmaster.ca) identity=helo; client-ip=130.113.128.28; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="carette@mcmaster.ca"; x-sender="postmaster@pinegw02.uts.mcmaster.ca"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncBAF4umlGCcYAcnGdsb2JhbABaxHeBFA4BAQEBAQgLCQkUKIIfAQEFMgEFQAEQCxgJFg8JAwIBAgFFBg0BBQIBAYgJux2ObjMHg1QDnVaOTQ X-IPAS-Result: AncBAF4umlGCcYAcnGdsb2JhbABaxHeBFA4BAQEBAQgLCQkUKIIfAQEFMgEFQAEQCxgJFg8JAwIBAgFFBg0BBQIBAYgJux2ObjMHg1QDnVaOTQ X-IronPort-AV: E=Sophos;i="4.87,707,1363129200"; d="scan'208";a="18182957" Received: from pinegw02.uts.mcmaster.ca ([130.113.128.28]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 20 May 2013 16:13:51 +0200 Received: from Gorash7.UTS.McMaster.CA (Gorash7.UTS.McMaster.CA [130.113.196.61]) by pinegw02.uts.mcmaster.ca (8.14.4/8.14.4) with ESMTP id r4KE7d9X013384; Mon, 20 May 2013 10:07:42 -0400 Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.McMaster.CA [130.113.64.46]) by Gorash7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id r4KE7RAY003715; Mon, 20 May 2013 10:07:27 -0400 Received: from [99.235.253.243] (account carette@univmail.cis.mcmaster.ca HELO [192.168.2.105]) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 5.2.12) with ESMTPSA id 458316637; Mon, 20 May 2013 10:08:08 -0400 Message-ID: <519A2E1F.5000101@mcmaster.ca> Date: Mon, 20 May 2013 10:07:27 -0400 From: Jacques Carette User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Markus Mottl CC: Alain Frisch , OCaml List References: <5199D14E.5000205@frisch.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-PMX-Version-Mac: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.5.20.135138 X-PerlMx-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, RCVD_FROM_IP_DATE 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_LESS 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, BODY_SIZE_800_899 0, DATE_TZ_NA 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MOZILLA_MSGID 0, __MOZILLA_USER_AGENT 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' X-Spam-Flag: NO Subject: Re: [Caml-list] First-class modules in functor bodies On 13-05-20 10:01 AM, Markus Mottl wrote: > On Mon, May 20, 2013 at 3:31 AM, Alain Frisch wrote: >> Here is an counter-example provided by Didier Rémy: > [snip] >> module F(U:sig end) = >> (val (if !b then (module X1 : X) else (module X2 : X)) : X) > Ah, yeah, that's evil. If only there were an _option_ to have OCaml track state in its types, lots of this would be greatly simplified, at least for those OCaml programmers willing to do that. I understand that not tracking state (or other effects) in OCaml types is a fundamental design decision that makes OCaml a hybrid functional-imperative language. I just wish I had the option of using it purely functionally, and the compiler would then give me all the accompanying riches that comes with that choice. Jacques