Boost logo

Boost :

Subject: Re: [boost] painless currying
From: Lars Viklund (zao_at_[hidden])
Date: 2011-08-24 03:48:26


On Tue, Aug 23, 2011 at 03:38:19PM -0400, Eric Niebler wrote:
> On a lark, I implemented a wrapper that turns any TR1-style function
> object into a "curryable" function object (attached). Successive
> function call invocations bind arguments until enough arguments are
> bound to invoke the wrapped function. With it you can do the following:
>
> curryable<std::plus<int> > p;
> auto curried = p(1);
> int i = curried(2);
> assert(i == 3);
>
> Is there any interest in such a thing?

For what it's worth, I made a feature request[1] about partial function
application in Phoenix on the trac a few months ago after discussing it
with Heller on IRC, but interest seemed mild, probably for lack of an
investigation of the side effects and the lack of a proof-of-concept
implementation.

[1] https://svn.boost.org/trac/boost/ticket/5541

-- 
Lars Viklund | zao_at_[hidden]

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