"fold": a replacement for "reduce"

monarch_dodra monarchdodra at gmail.com
Thu Mar 27 08:49:08 PDT 2014


On Thursday, 27 March 2014 at 15:33:39 UTC, Meta wrote:
> On Thursday, 27 March 2014 at 13:23:27 UTC, monarch_dodra wrote:
>> "fold" (from what I understood) is what you call "foldl". It 
>> was discussed to not introduce "foldr", as it's just 
>> "fold!(binaryReverseArgs!Fun)(range.retro);".
>
> Rolls right off the tongue. We seriously need a better alias 
> for binaryReverseArgs.

Arguably, we could just have a generic "reverseArgs". Not sure 
why it's restrained to "binary" to begin with.

In any case, I don't disagree, but the point is that "fold" is 
not special in that regard. If "foldr" was justified, then so 
would "filterr", "joinerr", "mapr" etc...


More information about the Digitalmars-d mailing list