islices

package
v0.0.0-...-6a1fe6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All[Slice ~[]Elem, Elem any](s Slice) iter.Seq2[int, Elem]

All returns an iterator over index-value pairs in the slice. The indexes range in the usual order, from 0 through len(s)-1.

func Append

func Append[Slice ~[]Elem, Elem any](x Slice, seq iter.Seq[Elem]) Slice

Append appends the values from seq to the slice and returns the extended slice.

func Backward

func Backward[Slice ~[]Elem, Elem any](s Slice) iter.Seq2[int, Elem]

Backward returns an iterator over index-value pairs in the slice, traversing it backward. The indexes range from len(s)-1 down to 0.

func Collect

func Collect[Elem any](seq iter.Seq[Elem]) []Elem

Collect collects values from seq into a new slice and returns it.

func Sorted

func Sorted[Elem cmp.Ordered](seq iter.Seq[Elem]) []Elem

Sorted collects values from seq into a new slice, sorts the slice, and returns it.

func SortedFunc

func SortedFunc[Elem any](seq iter.Seq[Elem], cmp func(Elem, Elem) int) []Elem

SortedFunc collects values from seq into a new slice, sorts the slice, and returns it.

func Values

func Values[Slice ~[]Elem, Elem any](s Slice) iter.Seq[Elem]

Values returns an iterator over the values in the slice, starting with s[0].

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL