220 13893 <543E7CB4.7020003@gmx.net> article
Path: news.gmane.org!not-for-mail
From: Jens Maurer <Jens.Maurer@gmx.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Comment on N4191 - Folding expressions (Sutton, Smith)
Date: Wed, 15 Oct 2014 15:55:00 +0200
Lines: 66
Approved: news@gmane.org
Message-ID: <543E7CB4.7020003@gmx.net>
References: <c0667403-de73-4dfb-947a-d25363d2928f@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1413381317 16032 80.91.229.3 (15 Oct 2014 13:55:17 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 15 Oct 2014 13:55:17 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDPMTYGK64JRBN7Z7GQQKGQE73Y5IWA@isocpp.org Wed Oct 15 15:55:09 2014
Return-path: <std-proposals+bncBDPMTYGK64JRBN7Z7GQQKGQE73Y5IWA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f70.google.com ([74.125.82.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDPMTYGK64JRBN7Z7GQQKGQE73Y5IWA@isocpp.org>)
	id 1XeP2i-0003DS-Pj
	for gclcip-std-proposals@m.gmane.org; Wed, 15 Oct 2014 15:55:09 +0200
Original-Received: by mail-wg0-f70.google.com with SMTP id a1sf760481wgh.5
        for <gclcip-std-proposals@m.gmane.org>; Wed, 15 Oct 2014 06:55:05 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to
         :subject:references:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=mE4qa+vuW0/BLIyvBk4t0EsLMvNAUj+JgYB+J+j3C+g=;
        b=aPNklcOIw13qrBhTZfTkGV9wjT62aNxXXfH4vgM0h8aGo11oEA/5syuka16hUDhfCu
         pxkfylUbtFKrCSlvodTy9k7qCCOKwMeEX/1iR9DscNM3oavqrTjxMagD256ZgnvAPsew
         lNobT4yTzdaS/wmElik2a003VNX92uXJqisoQqBN8VDVUCfbvCTXZ+4vnszrRVu/7M43
         NWrjPEwEC8Y6L1XUKRDrAv4I6hMIFd+RFjfDHcrUr0igd9H1wIKyOEuOVeSQPDP7JLk/
         M7/K5f5y1f3t6pYWO22H/yisKUnVD4NroKvyLJun3Nyv7rSZtreCLx9VoqaMBGd1aUHS
         1W3Q==
X-Gm-Message-State: ALoCoQnzXMbQoCXRqWwjYzYrPC97HZbi3RDrwG7gIxNk1l+jal8y55TT5wYC3+DmRnDokTE9por0
X-Received: by 10.180.19.198 with SMTP id h6mr99285wie.5.1413381305323;
        Wed, 15 Oct 2014 06:55:05 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.88.13 with SMTP id bc13ls65346lab.21.gmail; Wed, 15 Oct
 2014 06:55:02 -0700 (PDT)
X-Received: by 10.152.20.199 with SMTP id p7mr12494474lae.49.1413381302942;
        Wed, 15 Oct 2014 06:55:02 -0700 (PDT)
Original-Received: from mout.gmx.net (mout.gmx.net. [212.227.17.20])
        by mx.google.com with ESMTPS id xt8si30516870lac.122.2014.10.15.06.55.02
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 15 Oct 2014 06:55:02 -0700 (PDT)
Received-SPF: pass (google.com: domain of Jens.Maurer@gmx.net designates 212.227.17.20 as permitted sender) client-ip=212.227.17.20;
Original-Received: from [192.168.2.100] ([92.208.227.175]) by mail.gmx.com (mrgmx101)
 with ESMTPSA (Nemesis) id 0LwF9u-1YE9lo0FJe-017zOb for
 <std-proposals@isocpp.org>; Wed, 15 Oct 2014 15:55:02 +0200
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1
In-Reply-To: <c0667403-de73-4dfb-947a-d25363d2928f@isocpp.org>
X-Provags-ID: V03:K0:gdCinSAmcHrdnR9J6R4dCcNWOMHFUKJSfQH6gxyim5+95H2v42b
 8wmOxv+gDZQBLI4W7h65/PYXXYGu6i+NicmrrxlgQdEybkI7aF1iRljB/sJLyz6KT/6tpCp
 bmjC9v4T9Xn35El6Ll78XTYx2ujx5cZWlzVBdAD2lmK3VmxccGLHdk26tGk86IjFqDh/AhD
 LOE/wBsFbmgKJITtvFzwA==
X-UI-Out-Filterresults: notjunk:1;
X-Original-Sender: Jens.Maurer@gmx.net
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of Jens.Maurer@gmx.net designates 212.227.17.20 as permitted sender) smtp.mail=Jens.Maurer@gmx.net
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:13893
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/13893>


I'd prefer not to derail N4191 with additional features
or depend on other proposals.

It seems your suggestions are purely add-on and should
be handled in a separate paper.

Jens


On 10/15/2014 01:45 PM, George Makrydakis wrote:
> Two observations on N4191:
> 
> First, given that the paper proposes making catamophisms (left and right folds) as a primary language construct,
> is there a reason as to why this should be limited to just values and not types as well? Instead of an operator, a
> template template parameter could be used as is the case for the following examples of valid C++11 code for
> providing the "folded" instantiation in this case:
> 
> #include <cstdio>
> 
> template< template<typename...> class F
>              , typename A, typename B, typename C, typename D>
> void fun (F<A,F<B,F<C,D>>>)
> { printf("folding in one way...\n"); }
> 
> template< template<typename...> class F
>              , typename A, typename B, typename C, typename D>
> void fun (F<F<F<A,B>,C>,D>)
> { printf("folding in another way...\n"); }
> 
> template<typename A, typename B>
> struct funny {};
> 
> int main() {
>     fun(funny<int,funny<int,funny<int,long>>>());
>     fun(funny<funny<funny<int,int>,int>,long>());
>     return {};
> }
> 
> With the intention of expanding this to packs of course, manipulating the tripple-dot syntax. Could N4191 address
> this as well in a future iteration?
> 
> Second, why should the folding expressions be limited to operators using (... + args) and not functions as well,
> using (... f args) as well with f being a function identifier, or some sort of other syntax including that f function
> can be used with, inspired for example from N4165 / N4174 (uniform function call syntax)?
> 
> Regards,
> 
> George
> 
> -- 
> 
> ---
> You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org <mailto:std-proposals+unsubscribe@isocpp.org>.
> To post to this group, send email to std-proposals@isocpp.org <mailto:std-proposals@isocpp.org>.
> Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
