Merge pull request #5951 from acehreli/TaskPool_fold

Fix Issue 18096 - Add fold() to std.parallelism
merged-on-behalf-of: Sebastian Wilzbach <sebi.wilzbach@gmail.com>
This commit is contained in:
The Dlang Bot 2018-01-17 06:05:48 +01:00 committed by GitHub
commit fa0a6192a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 196 additions and 11 deletions

View file

@ -2747,9 +2747,9 @@ Params:
See_Also:
$(HTTP en.wikipedia.org/wiki/Fold_(higher-order_function), Fold (higher-order function))
$(LREF fold) is functionally equivalent to $(LREF _reduce) with the argument order reversed,
and without the need to use $(LREF tuple) for multiple seeds. This makes it easier
to use in UFCS chains.
$(LREF fold) is functionally equivalent to $(LREF _reduce) with the argument
order reversed, and without the need to use $(REF_ALTTEXT $(D tuple),tuple,std,typecons)
for multiple seeds. This makes it easier to use in UFCS chains.
$(LREF sum) is similar to `reduce!((a, b) => a + b)` that offers
pairwise summing of floating point numbers.
@ -3206,8 +3206,9 @@ See_Also:
$(LREF sum) is similar to `fold!((a, b) => a + b)` that offers
precise summing of floating point numbers.
This is functionally equivalent to $(LREF reduce) with the argument order reversed,
and without the need to use $(LREF tuple) for multiple seeds.
This is functionally equivalent to $(LREF reduce) with the argument order
reversed, and without the need to use $(REF_ALTTEXT $(D tuple),tuple,std,typecons)
for multiple seeds.
+/
template fold(fun...)
if (fun.length >= 1)