220 36519 <1A30B57E-40F5-452C-850C-55AF5F20F073@gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Jonathan Coe <jonathanbcoe@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Currying or Partial Application
Date: Sat, 6 Jan 2018 19:18:55 +0000
Lines: 111
Approved: news@gmane.org
Message-ID: <1A30B57E-40F5-452C-850C-55AF5F20F073@gmail.com>
References: <835cc86a-2e6c-4e17-aec7-4f16cf8b085f@isocpp.org> <7A4EE214-FE5B-4EC2-BE9E-23522F55EE5B@gmail.com> <CAC+0CCMtAos5KpLmvDAkxCNfBFJQQqKrTZh7jfhv6vCKKFbtJw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0 (1.0)
Content-Type: multipart/alternative;
	boundary=Apple-Mail-2421A84B-269F-43DD-BDB5-E116231E05E5
Content-Transfer-Encoding: 7bit
X-Trace: blaine.gmane.org 1515266221 19711 195.159.176.226 (6 Jan 2018 19:17:01 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 6 Jan 2018 19:17:01 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC2JVFPBRAHBBIOCYTJAKGQEFWQCX5I@isocpp.org Sat Jan 06 20:16:57 2018
Return-path: <std-proposals+bncBC2JVFPBRAHBBIOCYTJAKGQEFWQCX5I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f69.google.com ([74.125.82.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC2JVFPBRAHBBIOCYTJAKGQEFWQCX5I@isocpp.org>)
	id 1eXtxf-0004mT-Mp
	for gclcip-std-proposals@m.gmane.org; Sat, 06 Jan 2018 20:16:55 +0100
Original-Received: by mail-wm0-f69.google.com with SMTP id o16sf2030257wmf.4
        for <gclcip-std-proposals@m.gmane.org>; Sat, 06 Jan 2018 11:18:59 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1515266339; cv=pass;
        d=google.com; s=arc-20160816;
        b=YMK3Mae1w2xVW9wsPpPET8Om/Dt6+bGDBiFpmaBGzeuAQyAmR1S37b7A6yw0Ijcqq5
         4O1HVuKN/8Z/F0ekaCuid8dowsuO4Z9ca63vw32YD1RHJHyuDwkQCPGBNDJxtKDvdnQC
         cSoTLphGRn9ofrbg9uuaiRqFazxvG8MnNDP7YAPsBSbySDK1ZjInV459mJlaZgFWjhH9
         VGKIHRHPoOo7V4EAyxRWms934IrJTh2iKmiHc+WRiHkT43WJf4Rh6AlwmTZmhn/SZjzD
         38fDX9IhHbXc46crxIV46ipsUZmqHYjM23sZ3PCfXOQwxnaLRyda2UFSdZe2zCM8C8bx
         6nYA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:in-reply-to:references
         :message-id:subject:date:mime-version:content-transfer-encoding:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=RGyRA6pA/9zaoazzAyCq6tOEqcCUtczToBLq/LWBVfs=;
        b=P6Jdm17UkAVxdwr35b+EPSCX4v3vVPLjSGvndcfcl0tR4dJqb26aDVQwWZg5BGnw5c
         g5SxDAKHrlByZKhLG5wtsj8iPWsjFOp1sVUgmaGrqCA6JbhFB70/HKxisKVLuOKUVTkp
         Ue4qew6eaM2EWKeG75hzu78Hrpgt88m18+QIZj71ZmlfnRR7jOonntg8HObqpPnezmmN
         CgWRRBq9PLlslMP8q8MR76FF6a7RzGrgxRLnqR2p/qFR50sC7vqB8AQxpwGXY/wirCmh
         x8bpCap1M9H1XL0gY8l0aO6ZjLBbpRCDFsgdYNK8AMlpo6EoH3CauhCMBDeaC74RM/wm
         fI9w==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=JiCEEem1;
       spf=pass (google.com: domain of jonathanbcoe@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jonathanbcoe@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:content-transfer-encoding:mime-version:date:subject:message-id
         :references:in-reply-to: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;
        bh=RGyRA6pA/9zaoazzAyCq6tOEqcCUtczToBLq/LWBVfs=;
        b=mD/Ubvhov0yfXvCz0lmQRV6Dc+b2K5MFHS8NbjjQn24YktGo97IgyVzzU8X7+mN6R+
         bLPAnxTMdBBpwVELaulG/cxhiPGcs9BFPkTQ5qNV1yePLJfm+7UAkVO3P/pqT+lPeonY
         DUEIc7IWLSMc0PPM8qaF2qf4D2VRGNgU2ZhI+OKs40pWaRXBxMve9W75sLScrr9BIkUW
         A55oCQVIi16g64S+tw7yRiY7lVnS3T68TITJew8E/0+GDoN574vbfsuvRNYNt7glfoo7
         HKwOeMqgtvdTqv65bhAUyK10EFs3ElbzweqytQZ9qaojBxpMp315hbo0YT0XgC1aBXR8
         F/hQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:content-transfer-encoding:mime-version:date
         :subject:message-id:references:in-reply-to:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=RGyRA6pA/9zaoazzAyCq6tOEqcCUtczToBLq/LWBVfs=;
        b=UImRGcgtN6+xdrHXh9WOXVQ4ieb05Oo+993rlGK4tp0dM1LnSkO/XIucSE6Fkb9Euk
         FuSGLAZbfksmTgYd/+qjw7t2SehjejjfrkcaKIgSDlLEXFhvj6gffyEfECqrn9upTsaf
         m/3WIog9iqN1kv6EJCGftCNJnrQD1WF2fIXrbIS0w7HrfkZC65QpI+kQVq9evI1esTRp
         wxSwG34POd0oWYNG2vtBcaQYGfHusS9/Gb534dbBqtQ2A2o9d2wETDay3EFDRumorh65
         s3emygkVJ52cwNhMw76QOt3BuhGJQtodMCthY2WriG0eFh3Rkj2bGjKSnCoUA38ILPW2
         rkj 
X-Gm-Message-State: AKGB3mIFldXqhJ+QoVtNNh97V1YdNHnLEP0stj8paJ5jkArL/Ohv2x+P
	8hmK00wPACdBmezvTTV0KFrlBg==
X-Google-Smtp-Source: ACJfBosIA+WjcmjlQIJcafpzAGFYLxP57Ek9U56VwuD4s+k6ijw3LyGLDTaYSAOkqgJGmSw1rVkJZQ==
X-Received: by 10.28.19.210 with SMTP id 201mr633666wmt.2.1515266339146;
        Sat, 06 Jan 2018 11:18:59 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.193.142 with SMTP id r136ls906331wmf.5.canary-gmail; Sat,
 06 Jan 2018 11:18:57 -0800 (PST)
X-Received: by 10.28.175.18 with SMTP id y18mr4947776wme.111.1515266337550;
        Sat, 06 Jan 2018 11:18:57 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1515266337; cv=none;
        d=google.com; s=arc-20160816;
        b=aLmIJkl6xziUHEVftda78NvYTRInz/AHMD1NWpXU34rncrm0USaVjOO46HKWlQIdjH
         59ErTJZGDzYPzsQQzAWvU5rhSpcRKpmoAk1b1SLWqO2nT5WNjcRwq1tLpzG1HTg899eV
         +Ya/x//2iKh3n5wESiEyEfe6Fo+EwfShGs9/wdhGIJh01LMN5Pw3kA6XeQKHGZ6AQxk9
         ++S/hHGyP9MsJiwDTtBRnLNH9kcrBBcTEXRHjdIA0a5J8OnuX9zp/CaLeZRdy76lcZ4k
         Ipzid4x4fWIZ5W9Igu6hRsiH+MM3MEn9BYpC5RoufMRDTIOIAzuGD5AYucfONskz2/aD
         oUTQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:in-reply-to:references:message-id:subject:date:mime-version
         :content-transfer-encoding:from:dkim-signature
         :arc-authentication-results;
        bh=RghplTOoOs4oxuEj6t9m3w0JejbDj96TTbGyGB1+ZAQ=;
        b=BdVWeHRoJbv7UhpXEQ2WFj2VePrz6tfkMxNGtjcg9VmvgvPGrl4aRHB1KtP+djNSFI
         O+aJmjo5QeS3FdFsxzHgOAK2F/p4JNTSsmX5uQX7zLidresWNGj4r8UQB7/qL8NqAzaB
         A2plKpxgA6s7xRS0hMNqDFPA/R8+fgBYqv5WVdhyQZE/6lsQEubef7XPCMO2Hncowwvd
         RQK3gQfJ2+ZBTyhetDegUTCii+dSNHOI/SSWJFCvHrwcgzF7dZu6a3qtRW7SDFUZobgg
         77iu26poceLEpZbmfCG5ThVTK5ePlBwp6mTeRvM1Qtwo2gUpJKZk2NVPWw5j760ZWyD3
         4n+w==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=JiCEEem1;
       spf=pass (google.com: domain of jonathanbcoe@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=jonathanbcoe@gmail.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id t65sor2097047wmt.26.2018.01.06.11.18.57
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sat, 06 Jan 2018 11:18:57 -0800 (PST)
Received-SPF: pass (google.com: domain of jonathanbcoe@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.28.122.15 with SMTP id v15mr4743047wmc.38.1515266337125;
        Sat, 06 Jan 2018 11:18:57 -0800 (PST)
Original-Received: from ?IPv6:2a00:23c4:732e:a00:d4d1:ea45:a1dc:3f78? ([2a00:23c4:732e:a00:d4d1:ea45:a1dc:3f78])
        by smtp.gmail.com with ESMTPSA id 62sm10156721wmo.33.2018.01.06.11.18.55
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 06 Jan 2018 11:18:56 -0800 (PST)
In-Reply-To: <CAC+0CCMtAos5KpLmvDAkxCNfBFJQQqKrTZh7jfhv6vCKKFbtJw@mail.gmail.com>
X-Mailer: iPhone Mail (15C153)
X-Original-Sender: jonathanbcoe@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=JiCEEem1;       spf=pass
 (google.com: domain of jonathanbcoe@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=jonathanbcoe@gmail.com;       dmarc=pass
 (p=NONE sp=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:36519
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36519>


--Apple-Mail-2421A84B-269F-43DD-BDB5-E116231E05E5
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



> On 6 Jan 2018, at 16:19, Jake Arkinstall <jake.arkinstall@gmail.com> wrot=
e:
>=20
>> On Sat, Jan 6, 2018 at 3:13 PM, Jonathan Coe <jonathanbcoe@gmail.com> wr=
ote:
>> Do you have an example of how this would allow one to re-write code in a=
 more maintainable way?
>=20
> I just realised my example doesn't fit your request for maintainability. =
From my experience with Haskell, I can say that it often makes code highly =
reusable, and there are a lot of very flexible Haskell libraries that are o=
nly a few dozen lines long due to this. Once a handful of basic functions a=
re in place, they can be used and abused in an incredible variety of ways, =
and you don't need to think twice about doing so. A lot of this (not all, b=
ut a lot) is due to partial application and parameter flipping.
>=20
> So in terms of reusability, maintainability can be improved.


Interesting. As you say, the example you give can be done with lambdas; do =
you have an example where lambdas are not a good fit?
> --=20
> 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.
> To view this discussion on the web visit https://groups.google.com/a/isoc=
pp.org/d/msgid/std-proposals/CAC%2B0CCMtAos5KpLmvDAkxCNfBFJQQqKrTZh7jfhv6vC=
KKFbtJw%40mail.gmail.com.

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/1A30B57E-40F5-452C-850C-55AF5F20F073%40gmail.com=
..

--Apple-Mail-2421A84B-269F-43DD-BDB5-E116231E05E5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto"><div></div><div><br></div><div><br>On 6=
 Jan 2018, at 16:19, Jake Arkinstall &lt;<a href=3D"mailto:jake.arkinstall@=
gmail.com">jake.arkinstall@gmail.com</a>&gt; wrote:<br><br></div><blockquot=
e type=3D"cite"><div><div dir=3D"ltr"><div class=3D"gmail_extra"><div class=
=3D"gmail_quote">On Sat, Jan 6, 2018 at 3:13 PM, Jonathan Coe <span dir=3D"=
ltr">&lt;<a href=3D"mailto:jonathanbcoe@gmail.com" target=3D"_blank">jonath=
anbcoe@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"auto"><span class=3D""><div></div><div>Do you have an example of =
how this would allow one to re-write code in a <i>more maintainable way</i>=
?</div></span></div></blockquote><div><br>I just realised my example doesn'=
t fit your request for maintainability. From my experience with Haskell, I =
can say that it often makes code highly <i>reusable</i>, and there are a lo=
t of very flexible Haskell libraries that are only a few dozen lines long d=
ue to this. Once a handful of basic functions are in place, they can be use=
d and abused in an incredible variety of ways, and you don't need to think =
twice about doing so. A lot of this (not all, but a lot) is due to partial =
application and parameter flipping.<br><br>So in terms of <i>reusability,</=
i>&nbsp;maintainability can be improved.</div></div></div></div></div></blo=
ckquote><div><br></div><div><br></div>Interesting. As you say, the example =
you give can be done with lambdas; do you have an example where lambdas are=
 not a good fit?<br><blockquote type=3D"cite"><div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCMtAos5KpLmvDAkxCNfBFJQQqKrTZ=
h7jfhv6vCKKFbtJw%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCMt=
Aos5KpLmvDAkxCNfBFJQQqKrTZh7jfhv6vCKKFbtJw%40mail.gmail.com</a>.<br>
</div></blockquote></body></html>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/1A30B57E-40F5-452C-850C-55AF5F20F073%=
40gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/1A30B57E-40F5-452C-850C-55AF5F20F073%=
40gmail.com</a>.<br />

--Apple-Mail-2421A84B-269F-43DD-BDB5-E116231E05E5--

.
