Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-08-24 18:15:03


on Wed Aug 24 2011, "Peter Dimov" <pdimov-AT-pdimov.com> wrote:

> Dave Abrahams wrote:
>
>> I suppose the symmetrical non-lazy version looks like:
>>
>> f(x) => doesn't call f
>> f(x)(y) => doesn't call f
>> f(x)(y)(z) => doesn't call f
>> f(x)(y)(z)() => calls f
>
> This allows you to express bind( f, x, y, z ), which was impossible
> before, but you've now lost the capability to express bind( f, x, y,
> _1 ), which was.
>
> bind( f, _1, y, z ), which is often needed in practice, is possible
> under neither, which makes me view this whole exercise as somewhat
> academic.

Yes, it has always been my view that bind was unambiguously better for
non-lazy languages, and at least more flexible even for lazy ones.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk