collection

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Permutations

func Permutations[S ~[]E, E any](in S) iter.Seq[S]

Permutations returns an iterator that yields permutations of in. The returned iterator reorders in in-place. Callers should not retain in or slices from the iterator, Or should explicitly clone yielded values.

func ReduceGroup

func ReduceGroup[K comparable, V, Sum any](seq iter.Seq2[K, V], reducer func(accumulator Sum, current V) Sum, initial Sum) map[K]Sum

func RunningReduce

func RunningReduce[V, Sum any](seq iter.Seq[V], reducer func(accumulator Sum, current V, i int) Sum, initial Sum) iter.Seq[Sum]

func SumOf

func SumOf[T any, E hiter.Numeric](seq iter.Seq[T], selector func(ele T) E) E

Types

This section is empty.

Jump to

Keyboard shortcuts

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