-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mapreduce
with multiple input containers
#27704
Comments
Agree that |
Changing
We could save 3 letters and go with |
|
This should be implementable now since |
Implement vararg methods for mapreduce similar to map, fixes #27704.
It occurs to me that it would be great if operations like
mapreduce(f, op, a, b)
actually worked wherea
andb
are two containers of the same length, like it does formap
.For me, there are two issues here.
mapreduce
that applieszip
to the inputs and the appropriate form.v0
term is a little annoying inmapreduce(f, op, v0, a)
. If it is optional, maybe it should be an optional argument or a keyword argument. And it can't be an optional (positional) argument when the last term is a varargs list of the input containers.My suggestion would be a signature something like
mapreduce(f, op, a...; v0 = nothing)
(we might need something other thannothing
, since it seems to mean something these days). Movingv0
would be necessary to have thev0
-lessmapreduce
algorithm with two or more input containers (since it can't magically infer whether the 3rd argument is meant to bev0
or a container to reduce over).xref: #27677 (comment) cc: @StefanKarpinski
The text was updated successfully, but these errors were encountered: