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 D975B7F02D for ; Tue, 21 Oct 2014 16:52:43 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lpw25@cam.ac.uk) identity=pra; client-ip=131.111.8.151; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="lpw25@cam.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of lpw25@cam.ac.uk) identity=mailfrom; client-ip=131.111.8.151; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="lpw25@cam.ac.uk"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@ppsw-51.csi.cam.ac.uk) identity=helo; client-ip=131.111.8.151; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="lpw25@cam.ac.uk"; x-sender="postmaster@ppsw-51.csi.cam.ac.uk"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsEADJxRlSDbwiXnGdsb2JhbABcvVQGmlQCgREWAREBAQEBAQgLCQkULoQDAQEDASdSBQsLISUPAQRJLogcCAS+HIVXAQEIAQEBAR4YhguKLgeESwWPZY8lkHGHeYM2AQEB X-IPAS-Result: AhsEADJxRlSDbwiXnGdsb2JhbABcvVQGmlQCgREWAREBAQEBAQgLCQkULoQDAQEDASdSBQsLISUPAQRJLogcCAS+HIVXAQEIAQEBAR4YhguKLgeESwWPZY8lkHGHeYM2AQEB X-IronPort-AV: E=Sophos;i="5.04,762,1406584800"; d="scan'208";a="102247493" Received: from ppsw-51.csi.cam.ac.uk ([131.111.8.151]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Oct 2014 16:52:43 +0200 X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from host86-181-34-203.range86-181.btcentralplus.com ([86.181.34.203]:59587 helo=netbook) by ppsw-51.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.157]:587) with esmtpsa (PLAIN:lpw25) (TLSv1.2:AES128-GCM-SHA256:128) id 1Xganj-0006RV-WZ (Exim 4.82_3-c0e5623) (return-path ); Tue, 21 Oct 2014 15:52:43 +0100 From: Leo White To: Arnaud Spiwack Cc: OCaML Mailing List References: <8638ahpq1m.fsf@cam.ac.uk> <86y4s9oah2.fsf@cam.ac.uk> X-Face: "XWxb[u_Z\PA_Y?9@|IA!!+jTb(/290-*ea/Un$I0B98.$n%eL.;2w*,z]WR#T:,p[ NBd++M7l]#7zj7!{~iw $W-"/=|dVjhT[D{4~gE}gK<2`.6fs!;uqqud]vs2N/3^m7{aS1V, Date: Tue, 21 Oct 2014 15:52:42 +0100 In-Reply-To: (Arnaud Spiwack's message of "Tue, 21 Oct 2014 15:19:44 +0200") Message-ID: <86fveho4p1.fsf@cam.ac.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] Manipulating Modules Modularly > Am I weird to run into this issue all the time or is it common? Depends which issue you mean. People run into the value restriction quite frequently but eta-expansion is usually considered an acceptable solution, although it does require a certain amount of boilerplate. Note that your problem can also be worked around for a fixed number of type parameters by defining your module types as: module type M = sig type 'a t val u : 'a t val p : 'a t -> 'a t -> 'a t end module type ME = sig type 'a t val ps: 'a t list -> 'a t end which will now work for types with 0 or 1 parameters. > PS: now that there are both applicative functors and generative functors, could applicative functors be restricted to > being pure, so that this sort of manipulation become possible in a generic way? That would break a lot of existing code and wouldn't work very well without a full effect system in the core language. Regards, Leo