You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
Support Go iterators (#46)
Iterators were introduced in Go 1.23. They allow `for` loops over custom sequences.
There are some breaking changes to the API, which is why it's being releases as v3. Notable changes are:
- `All()` no longer exists. You can use the now native: `maps.Collect(m.AllFromFront())` for elements, or `slices.Collect(m.Keys())` for keys.
- `Iterator()` and `ReverseIterator()` are now `AllFromFront()` and `AllFromBack()` respectively.
- `Keys()` now returns an `iter.Seq` iterator instead of a list of keys. This should be much more performant on large maps. It is also more consistent with `maps.Keys` from the standard library.
- Added `Values()` which returns an `iter.Seq` iterator. It is also consistent with `maps.Values` from the standard library.
Fixes #44