aboutsummaryrefslogtreecommitdiff
path: root/doc/next
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2024-03-01 17:40:50 -0800
committerGopher Robot <gobot@golang.org>2024-05-09 19:20:55 +0000
commit0b5f72251bb564c7780b61f56a37faab31ed3512 (patch)
tree1fe53ec8a24044993d6a425f5aedc72c65197f40 /doc/next
parentcecbf4f28eed1327249ebb39e13c2e3ec6d12476 (diff)
downloadgo-0b5f72251bb564c7780b61f56a37faab31ed3512.tar.gz
go-0b5f72251bb564c7780b61f56a37faab31ed3512.zip
slices: add iterator-related functions
Fixes #61899 Change-Id: Icbde1ac8293723eefc3251008ae9711e756ed1b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/568477 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'doc/next')
-rw-r--r--doc/next/6-stdlib/3-iter.md17
-rw-r--r--doc/next/6-stdlib/99-minor/slices/61899.md1
2 files changed, 18 insertions, 0 deletions
diff --git a/doc/next/6-stdlib/3-iter.md b/doc/next/6-stdlib/3-iter.md
index 15ae7d47db..bc74f4556c 100644
--- a/doc/next/6-stdlib/3-iter.md
+++ b/doc/next/6-stdlib/3-iter.md
@@ -2,3 +2,20 @@
The new [`iter` package](/pkg/iter/) provides the basic definitions for
working with user-defined iterators.
+
+The [`slices` package](/pkg/slices/) adds several functions that work
+with iterators:
+- [All](/pkg/slices#All) returns an iterator over slice indexes and values.
+- [Values](/pkg/slices#Values) returns an iterator over slice elements.
+- [Backward](/pkg/slices#Backward) returns an iterator that loops over
+ a slice backward.
+- [Collect](/pkg/slices#Collect) collects values from an iterator into
+ a new slice.
+- [AppendSeq](/pkg/slices#AppendSeq) appends values from an iterator to
+ an existing slice.
+- [Sorted](/pkg/slices#Sorted) collects values from an iterator into a
+ new slice, and then sorts the slice.
+- [SortedFunc](/pkg/slices#SortedFunc) is like `Sorted` but with a
+ comparison function.
+- [SortedStableFunc](/pkg/slices#SortedStableFunc) is like `SortFunc`
+ but uses a stable sort algorithm.
diff --git a/doc/next/6-stdlib/99-minor/slices/61899.md b/doc/next/6-stdlib/99-minor/slices/61899.md
new file mode 100644
index 0000000000..02d77cd11d
--- /dev/null
+++ b/doc/next/6-stdlib/99-minor/slices/61899.md
@@ -0,0 +1 @@
+<!-- see ../../3-iter.md -->