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

New API for Go 1.23 #17

Closed
wants to merge 10 commits into from
Closed

New API for Go 1.23 #17

wants to merge 10 commits into from

Conversation

bobg
Copy link
Owner

@bobg bobg commented Jul 24, 2024

This PR revamps the go-generics API for Go 1.23, which notably adds the "range over func" language feature and the iter.Seq and iter.Seq2 types, plus some associated functions in the slices and maps stdlib packages.

As such there is no longer a need for this module's earlier iter.Of type. Nor can this module's iter package work as a drop-in replacement for the stdlib iter, because Go does not yet support generic type aliases. (The stdlib iter defines the generic Seq and Seq2 types, and a drop-in replacement could work only by creating aliases for those types. Duplicating those type definitions would create new, distinct types that wouldn't work with the rest of the standard library.)

Therefore the iter package is replaced with a new seqs package providing many of the same features, all reimplemented in terms of Go's new iterators.

After adapting to changes in Go 1.23, this module's maps package added even less than it did before, so it has been removed.

@bobg bobg changed the title Bobg/v4 New API for Go 1.23 Jul 24, 2024
@bobg bobg closed this Aug 17, 2024
@bobg bobg deleted the bobg/v4 branch August 17, 2024 03:46
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

Successfully merging this pull request may close these issues.

1 participant