On Fri, Jun 22, 2012 at 12:12 AM, Artur Skawina wrote:
> Sure, but partial application would be enough for cases like this one.
>
> I wonder if there's a case for "real" currying in 'D'; still can't think
> of one, but maybe that's just because it's not how i would usually code it.
Ah yes, you'r
On 06/21/12 21:04, Philippe Sigaud wrote:
> On Tue, Jun 19, 2012 at 2:52 PM, Artur Skawina wrote:
>
>> I'm not really sure when you'd want to use this in D.
>
> As for Haskell. For example, with a range of ranges and you want to
> take the first 100 elements of all subranges:
>
> alias Curry!ta
On Thursday, 21 June 2012 at 19:04:32 UTC, Philippe Sigaud wrote:
As for Haskell. For example, with a range of ranges and you
want to
take the first 100 elements of all subranges:
alias Curry!take ctake;
auto target = [[0,1,2,...], [...], ];
auto first100s = map!(ctake(100))(target);
To me,
On Thursday, 21 June 2012 at 19:04:32 UTC, Philippe Sigaud wrote:
On Tue, Jun 19, 2012 at 2:52 PM, Artur Skawina
But, just to be able to say "Real Programmers don't use
mixins": :)
I find Bearophile version quite nice. I did something
equivalent a few
years ago, with string mixins also. […]
Philippe Sigaud:
alias Curry!take ctake;
auto target = [[0,1,2,...], [...], ];
auto first100s = map!(ctake(100))(target);
The first argument of std.range.take is the range, this is handy
for chaining with UFCS.
I think currently curry!take doesn't work because take is not a
function (but
On Tue, Jun 19, 2012 at 2:52 PM, Artur Skawina wrote:
> I'm not really sure when you'd want to use this in D.
As for Haskell. For example, with a range of ranges and you want to
take the first 100 elements of all subranges:
alias Curry!take ctake;
auto target = [[0,1,2,...], [...], ];
auto fir
On 06/18/12 22:24, bearophile wrote:
> I think std.functional.curry is badly named because I think it's a "partial
> application" (I suggest to rename it).
> In Haskell and Scala currying is built-in, this is Haskell, shell (ghci):
>
> Prelude> let foo x y z = x * 2 + y * 3 + y * 5
> Prelude> let
I think std.functional.curry is badly named because I think it's
a "partial application" (I suggest to rename it).
In Haskell and Scala currying is built-in, this is Haskell, shell
(ghci):
Prelude> let foo x y z = x * 2 + y * 3 + y * 5
Prelude> let foo1 = foo 5
Prelude> let foo2 = foo1 4
Pre