[Issue 8142] std.functional.curry isn't flexible enough

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8142 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --

[Issue 8142] New: std.functional.curry isn't flexible enough

2012-05-24 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=8142 Summary: std.functional.curry isn't flexible enough Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2

Re: std.functional.curry isn't

2010-06-25 Thread Graham Fawcett
On Thu, 24 Jun 2010 20:19:47 -0500, Andrei Alexandrescu wrote: On 06/24/2010 07:06 PM, Graham Fawcett wrote: Hi folks, The template std.functional.curry(alias fun, alias arg) claims to curry fun by tying its first argument to a particular value. That is not currying; it is partial

Re: std.functional.curry isn't

2010-06-25 Thread Andrei Alexandrescu
On 06/25/2010 08:39 AM, Graham Fawcett wrote: On Thu, 24 Jun 2010 20:19:47 -0500, Andrei Alexandrescu wrote: On 06/24/2010 07:06 PM, Graham Fawcett wrote: Hi folks, The template std.functional.curry(alias fun, alias arg) claims to curry fun by tying its first argument to a particular value.

Re: std.functional.curry isn't

2010-06-25 Thread Philippe Sigaud
On Fri, Jun 25, 2010 at 16:36, Andrei Alexandrescu seewebsiteforem...@erdani.org wrote: On 06/25/2010 08:39 AM, Graham Fawcett wrote: Thank you. http://d.puremagic.com/issues/show_bug.cgi?id=4391 Great. I'm hoping for a patch that fixes the problem, but it's good to have the report we

std.functional.curry isn't

2010-06-24 Thread Graham Fawcett
Hi folks, The template std.functional.curry(alias fun, alias arg) claims to curry fun by tying its first argument to a particular value. That is not currying; it is partial application. In particular, it is a kind of partial application called a left section, because the argument provided is

Re: std.functional.curry isn't

2010-06-24 Thread Bill Baxter
On Thu, Jun 24, 2010 at 5:06 PM, Graham Fawcett fawc...@uwindsor.ca wrote: Hi folks, The template std.functional.curry(alias fun, alias arg) claims to curry fun by tying its first argument to a particular value. That is not currying; it is partial application. In particular, it is a kind of

Re: std.functional.curry isn't

2010-06-24 Thread bearophile
Graham Fawcett: If this were a real curry, you would write it like this: int fun(int a, int b) { return a + b; } assert(curry!(fun)(5)(6) == 11); Right. Better to change the name. Regarding std.functional, are the HOF adjoin(), compose() and pipe() useful? I don't think I'll use compose() or

Re: std.functional.curry isn't

2010-06-24 Thread Andrei Alexandrescu
On 06/24/2010 07:06 PM, Graham Fawcett wrote: Hi folks, The template std.functional.curry(alias fun, alias arg) claims to curry fun by tying its first argument to a particular value. That is not currying; it is partial application. [...] Confusing curring and partial application is a very

Re: std.functional.curry isn't

2010-06-24 Thread Andrei Alexandrescu
On 06/24/2010 07:37 PM, bearophile wrote: Graham Fawcett: If this were a real curry, you would write it like this: int fun(int a, int b) { return a + b; } assert(curry!(fun)(5)(6) == 11); Right. Better to change the name. I think it would be even better to redefine curry to do actual

Re: std.functional.curry isn't

2010-06-24 Thread bearophile
Andrei Alexandrescu: I think it would be even better to redefine curry to do actual currying. Right. I'm finding them quite useful, particularly in conjunction with e.g. map. Oh, OK. Then let's keep them :-) What do you think about the apply? Bye, bearophile