220 36506 <7A4EE214-FE5B-4EC2-BE9E-23522F55EE5B@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 15:13:11 +0000
Lines: 292
Approved: news@gmane.org
Message-ID: <7A4EE214-FE5B-4EC2-BE9E-23522F55EE5B@gmail.com>
References: <835cc86a-2e6c-4e17-aec7-4f16cf8b085f@isocpp.org>
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-426FBF5A-A15F-43F1-A56B-B36C01A4AD04
Content-Transfer-Encoding: 7bit
X-Trace: blaine.gmane.org 1515251481 31044 195.159.176.226 (6 Jan 2018 15:11:21 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 6 Jan 2018 15:11:21 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC2JVFPBRAHBBC6PYPJAKGQEZ6OHBSI@isocpp.org Sat Jan 06 16:11:17 2018
Return-path: <std-proposals+bncBC2JVFPBRAHBBC6PYPJAKGQEZ6OHBSI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f70.google.com ([74.125.82.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC2JVFPBRAHBBC6PYPJAKGQEZ6OHBSI@isocpp.org>)
	id 1eXq7s-0007PA-Ou
	for gclcip-std-proposals@m.gmane.org; Sat, 06 Jan 2018 16:11:12 +0100
Original-Received: by mail-wm0-f70.google.com with SMTP id o16sf1871810wmf.4
        for <gclcip-std-proposals@m.gmane.org>; Sat, 06 Jan 2018 07:13:16 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1515251596; cv=pass;
        d=google.com; s=arc-20160816;
        b=RyZxDXPazryBcjidV18l4ouFaa1tOCNKL0F43wXYfks6XbFvXx19m0RFYEnFEyWWx3
         IMh0h9bnE8rXQBiaSnfhXTyPavr3KbvzCFTjipMShqYa5b/Ar/EQsEgXOycgpu9Kypqe
         TuQSSYmNvCU6tXtGkwdOAN31KvME7U+Y7f7DHuF7J3VW9ugIi26Tr0rK686YYdF39ds0
         Zpu52SpAoMaTDOHTW5lS4JTBnzCSwf9XKYd4XH/jGpaAejYxuZDV4Um+pmr5KjFT4Ydt
         buKce+FAbBuR6XlK9/7+GCDgdDUlpM7ByhcTFD2EZYzSQnBlQNSPliZGkhav3gueCkID
         IUzw==
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=/3S30D+rQAf2RWpoKvqquH9aJ/jlympWMYtg/9TU4NI=;
        b=bt32uHX5z0PfFw1rnCQGGaf3ruFhCBWu9lV8TRnwdcdjQqrc1N9FP18OcrkTR3BAwW
         mHCKP2kmvGibNFpkY7pXg41LkKeTaFWn37vQ/eFZrQXuOFhsox9QUfghWapE+oE0Gd50
         P/CbAmzMFN3lzz4MjcbqSK5iDrUexGBrD9+0bjmiP/XcM5Q5NgQLJKmwf26eDmHiMxzs
         6iP/NkO2yai3uiYGjY7nphiMxEOpWiiHUAgHKjf3pxjanG77l51+/TG75WVYLKh5NyNj
         JPYM+wuFaVYQFViHkBVLMejB1PjOKwj6xaszSuyPCK+ju6t+VF0XH5IBwNvN3hqR6DEg
         JsTA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=QrFnmyt6;
       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=/3S30D+rQAf2RWpoKvqquH9aJ/jlympWMYtg/9TU4NI=;
        b=rR//tf4N93raELFgG6wUJRHxUscR6YQeWupyo7ijZUwzgM8M4ziW7CRuRQ9vdJr+kO
         68pcbfQBxrh0txABf5yjEsdenqD0rSZU2RjMih277DtqSij9UB4x4rKIQuTp8xkv0hOw
         +pYU66DDiWpZc48Y6GHpIgVU3NBBWHIw+x13NhO01fXn9At5NvztoZN4WSrw4Em7I+6d
         G07uV0qyPhaN8PaB9ToHInQE9yYGN0nyfvXRJgjrcHk3cVZr1rpYG4PvAQHDjN8P6mJT
         ZArHKioOkKzeY4RUUM49KNi9JKUS+QgCIuHWUFNHjDAKL64ZXQ+sBdN6s8u5eEqTyrf4
         tW7A==
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=/3S30D+rQAf2RWpoKvqquH9aJ/jlympWMYtg/9TU4NI=;
        b=rU2SPgY2s7IuN+oVy5hGdEEeUDH2gSdxgmSuoFXEBD4S5tUfEa2w8VoOmnD8VyTSRL
         sQWiYFhzjHKme2zU/8FMcxQ5Kh/j3kiYT3jTioCIMGjhAZVs2bqVbP/WMuVHKAVW7vK1
         3Ks7qW6Vz1o4oVCdP7Vi9wNa5mP4QY+MoYvlJwsexKH5r7lwZL2TwLJgo7qk2E3zjYNG
         WniYCmstVAutyH62AGJo4Pmn/6ng2m3YVezMGReDqlYIyRAFxNbIqH/SeO9b3+8cW2Oy
         4evW6d8NK7/x1cY8tVrckaI8cAexYKat8ew85iPjn7rEpcTUqFBOBu1ORot4I2MR+W/N
         Snb 
X-Gm-Message-State: AKGB3mJLEjmDt+15aqw2V7HoZk01NpwdX7uivDfIjIB4EHPgzI27hv/f
	3NWrXPMXLgga4MnquWr/iv3hUg==
X-Google-Smtp-Source: ACJfBovMFHMvbFmRhjVEuQkyy4rnhoRMHsv5a8moSSAzgX+xSglBqbjyDz663hVg++njsDv3kWewkw==
X-Received: by 10.223.164.148 with SMTP id g20mr686989wrb.13.1515251596183;
        Sat, 06 Jan 2018 07:13:16 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.35.14 with SMTP id j14ls837368wmj.11.gmail; Sat, 06 Jan
 2018 07:13:14 -0800 (PST)
X-Received: by 10.28.112.13 with SMTP id l13mr4965974wmc.16.1515251594750;
        Sat, 06 Jan 2018 07:13:14 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1515251594; cv=none;
        d=google.com; s=arc-20160816;
        b=e4cRdt2BZU27HxNg0vyyCeM6JGhljJ8Yv05Jr0hJ1eh7ujLxwLdfpjiRBpNPQhckBX
         rItrtGb5lVJR8oFxKh0z0PyXBr0d2JZGZLAXBkooLn7vGedWwz21Zq+FFR+pfX9ZJn1N
         hlh4AP1VUGg/Mv9E0hm1jk6bOoTFlVoHBpy1foy4mBNa713F4YG0kDy7r3hG+O0X4aE4
         /Yb8/2Gr5Rg57+kr7GD+4I/8asYmaZevz93UDm6KpmVT5AIZtJPd4mMcApBaokoiQx86
         yMdScl3let/+sr+kJqOi/4ZTo/dcMF5wILiayZIVnOkrpR32LFefADXMn5vRNGapSfxm
         oM4g==
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=VvKQE+gxEb2I76gwvhEvlFJvsuuRMxpVHDkF0HfQPU4=;
        b=NGkfk0ZIl3eV2VtA4YuXjdoNBFITvmmNquAwgRl4T1xyzly9xaIKWyGDEw1Hh7ywzR
         iZKxAuTFOUZ19aMN5tLYdSJOPY702VIN9oRxJ2s/R/A2XvLYKyYSHh4clOwgN/S+ZESf
         e8hO65yTH4YQJs/ayZmDHNfVPAd+FvoPfO5FqWmABRH/1m53n+l6Z6Fan3qQdccSf7Dq
         mNi0Rh1/PueqwSpCuySvE92aX+fTB9g1fujP4hPhO5hKdYZAD4Ng7asLBJtu8FCXNR3W
         oz2di9h2lztz4Rz8xC6UGVc1XTSxr6L/vCFPc00iLrdv+OlK2ceSU7TcMw8kA3RO/Qt5
         cACQ==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=QrFnmyt6;
       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 w102sor3538124wrb.45.2018.01.06.07.13.14
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Sat, 06 Jan 2018 07:13:14 -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.223.190.12 with SMTP id n12mr5276748wrh.102.1515251594119;
        Sat, 06 Jan 2018 07:13:14 -0800 (PST)
Original-Received: from [10.85.118.86] ([149.254.248.86])
        by smtp.gmail.com with ESMTPSA id 52sm9027670wrz.80.2018.01.06.07.13.12
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 06 Jan 2018 07:13:12 -0800 (PST)
In-Reply-To: <835cc86a-2e6c-4e17-aec7-4f16cf8b085f@isocpp.org>
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=QrFnmyt6;       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:36506
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36506>


--Apple-Mail-426FBF5A-A15F-43F1-A56B-B36C01A4AD04
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



> On 6 Jan 2018, at 14:12, Sarfaraz Nawaz <nawazzz@gmail.com> wrote:
>=20
>=20
> As C++ is becoming more functional with its each release, I think we shou=
ld also think in the direction of function partial application.
>=20
> Here is one syntax (inspired from Scala):
>=20
>=20
> int f(int a)(int b)(int c)  // #1
> {
>    return a + b + c;
> }
>=20
>=20
> f(10, 20, 30); // normal. full application
>=20
> f(10, 20)(30); // partial application
>=20
> f(10)(20, 30); // partial application
>=20
> f(10)(20)(30); // partial application
>=20
>=20
>=20
> Now what if we have an overload function like:
>=20
>=20
> int f(int a)(std::string b)(int c)  // #2
> {
>   //...
> }
>=20
>=20
>=20
> then `f(10)` is ambiguous. In that case, we could disambiguate as:
>=20
>=20
> auto f1 =3D f(10)(int); //Or  auto f1 =3D f(10) :: (int) ... stealing fro=
m Haskell?
>=20
> f1(20, 30); // calls #1
>=20
> auto f2 =3D f(10)(std::string);=20
>=20
> f2("Might work")(20); //calls #2
>=20
>=20
>=20
>=20
> Thoughts?
>=20

Do you have an example of how this would allow one to re-write code in a mo=
re maintainable way? I=E2=80=99m not familiar with Scala or the advantages =
that partial application can bring.

Thanks

Jon

> --=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/835cc86a-2e6c-4e17-aec7-4f16cf8b085f%40isocpp.=
org.

--=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/7A4EE214-FE5B-4EC2-BE9E-23522F55EE5B%40gmail.com=
..

--Apple-Mail-426FBF5A-A15F-43F1-A56B-B36C01A4AD04
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 14:12, Sarfaraz Nawaz &lt;<a href=3D"mailto:nawazzz@gmail.com=
">nawazzz@gmail.com</a>&gt; wrote:<br><br></div><blockquote type=3D"cite"><=
div><div dir=3D"ltr"><div><br></div><div>As C++ is becoming more functional=
 with its each release, I think we should also think in the direction of fu=
nction partial application.</div><div><br></div><div>Here is one syntax (in=
spired from Scala):</div><br><div class=3D"prettyprint" style=3D"background=
-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style:=
 solid; border-width: 1px; word-wrap: break-word;"><code class=3D"prettypri=
nt"><div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">)(</span><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> b</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)(</span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> c</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> &nbsp;<=
/span><span style=3D"color: #800;" class=3D"styled-by-prettify">// #1</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp;</span><span s=
tyle=3D"color: #008;" class=3D"styled-by-prettify">return</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> a </span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">+</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> b </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">+</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> c</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br><br>f</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">10</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">20</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
30</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #800;" class=3D"styled-by-prettify">// normal. full applicati=
on</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=
f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><=
span style=3D"color: #066;" class=3D"styled-by-prettify">10</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;=
" class=3D"styled-by-prettify">20</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)(</span><span style=3D"color: #066;" class=3D"styl=
ed-by-prettify">30</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 </span><span style=3D"color: #800;" class=3D"styled-by-prettify">// partia=
l application</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br><br>f</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">(</span><span style=3D"color: #066;" class=3D"styled-by-prettify">10</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">)(</span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">20</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" cla=
ss=3D"styled-by-prettify">30</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>// </span><span style=3D"color: rgb(136, 0, 0);"><span style=3D"color: #80=
0;" class=3D"styled-by-prettify">partial application</span></span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br><br>f</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">10</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">)(</span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">20</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">)(</span><span style=3D"color: #066;" class=3D"styled-by-pr=
ettify">30</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #800;" class=3D"styled-by-prettify">// </span><span s=
tyle=3D"color: rgb(136, 0, 0);"><span style=3D"color: #800;" class=3D"style=
d-by-prettify">partial application</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br></span></span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br></span></div></code></div><div><br><br>Now wha=
t if we have an overload function like:<br><br></div><div class=3D"prettypr=
int" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, =
187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;">=
<code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> f</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> a</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)(</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">std</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">string</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> b</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">)(</span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> c</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> &nbsp;</span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>// #2</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; </span><=
span style=3D"color: #800;" class=3D"styled-by-prettify">//...</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br><br></span></div></code></div><di=
v><span class=3D"styled-by-prettify" style=3D"font-family: monospace; backg=
round-color: rgb(250, 250, 250); color: rgb(102, 102, 0);"><br></span><span=
 class=3D"styled-by-prettify" style=3D"font-family: monospace; background-c=
olor: rgb(250, 250, 250); color: rgb(0, 0, 0);"><br>then `f(10)` is ambiguo=
us. In that case, we could disambiguate as:</span></div><div><span class=3D=
"styled-by-prettify" style=3D"font-family: monospace; background-color: rgb=
(250, 250, 250); color: rgb(0, 0, 0);"><br></span></div><div><span class=3D=
"styled-by-prettify" style=3D"font-family: monospace; background-color: rgb=
(250, 250, 250);"><div class=3D"prettyprint" style=3D"background-color: rgb=
(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bor=
der-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint" style=
=3D""><div class=3D"subprettyprint" style=3D""><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">auto</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> f1 </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">10</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">)(</span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">//Or &nbsp;auto f1 =3D f(10) :: (int) ... stealing =
from Haskell?</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br><br>f1</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">(</span><font color=3D"#006666"><span style=3D"color: #066;" class=3D"st=
yled-by-prettify">20</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">30</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">// calls #1</span></font><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">auto</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> f2 </span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> f</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">(</span><span style=3D"color: #066;" class=3D"styled-b=
y-prettify">10</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">)(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">std<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">string</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> <br><br>f2</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">"Might work"</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">)(</span><font color=3D"#006666"><s=
pan style=3D"color: #066;" class=3D"styled-by-prettify">20</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;=
" class=3D"styled-by-prettify">//calls #2</span></font><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br><br><br></span></div></code></div=
><br><br>Thoughts?<br><br></span></div></div></div></blockquote><div><br></=
div><div>Do you have an example of how this would allow one to re-write cod=
e in a more maintainable way? I=E2=80=99m not familiar with Scala or the ad=
vantages that partial application can bring.</div><div><br></div><div>Thank=
s</div><div><br></div><div>Jon</div><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/835cc86a-2e6c-4e17-aec7-4f16cf8b085f%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.goo=
gle.com/a/isocpp.org/d/msgid/std-proposals/835cc86a-2e6c-4e17-aec7-4f16cf8b=
085f%40isocpp.org</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/7A4EE214-FE5B-4EC2-BE9E-23522F55EE5B%=
40gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7A4EE214-FE5B-4EC2-BE9E-23522F55EE5B%=
40gmail.com</a>.<br />

--Apple-Mail-426FBF5A-A15F-43F1-A56B-B36C01A4AD04--

.
