Skip to content

internal/sliceutil: add utilities to map values#47209

Merged
thaJeztah merged 1 commit intomoby:masterfrom
corhere:sliceutil-map
Jan 25, 2024
Merged

internal/sliceutil: add utilities to map values#47209
thaJeztah merged 1 commit intomoby:masterfrom
corhere:sliceutil-map

Conversation

@corhere
Copy link
Contributor

@corhere corhere commented Jan 24, 2024

Functional programming for the win! Add a utility function to map the values of a slice, along with a curried variant, to tide us over until equivalent functionality gets added to the standard library (https://go.dev/issue/61898)

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Functional programming for the win! Add a utility function to map the
values of a slice, along with a curried variant, to tide us over until
equivalent functionality gets added to the standard library
(https://go.dev/issue/61898)

Signed-off-by: Cory Snider <csnider@mirantis.com>
@cpuguy83
Copy link
Member

I'm fine adding these, but without any actual consumers?
Note there's also x/exp/slices and x/exp/maps.

@corhere
Copy link
Contributor Author

corhere commented Jan 24, 2024

The consumer I had in mind for this is currently in a PR. A backlink should appear momentarily, once I submit my review for it.

x/exp/slices does not have analogous functionality. The golang/go issue I linked in the PR description is an open proposal to add a new package x/exp/xiter with a Map function.

@thaJeztah thaJeztah added status/2-code-review kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. labels Jan 25, 2024
@thaJeztah thaJeztah added this to the 26.0.0 milestone Jan 25, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 8619881 into moby:master Jan 25, 2024
@corhere corhere deleted the sliceutil-map branch January 25, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants