Skip to content
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

merge(op, nt1, nt2, ...) #36274

Closed
cossio opened this issue Jun 14, 2020 · 1 comment
Closed

merge(op, nt1, nt2, ...) #36274

cossio opened this issue Jun 14, 2020 · 1 comment

Comments

@cossio
Copy link
Contributor

cossio commented Jun 14, 2020

I think it would be nice to have a merge method (for NamedTuples) that took a function op as a first argument and the combined values using f to form the resulting NamedTuple.

For example, it could be implemented like this:

merge(op, nt::NamedTuple{K,V}...) where {K,V} = NamedTuple{K}(op.(values.(nt)...))
@tkf
Copy link
Member

tkf commented Jun 14, 2020

Let's track this issue in #36048.

@tkf tkf closed this as completed Jun 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants