xiter

package module
v0.0.0-...-b5df543 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flip

func Flip[K, V any](seq iter.Seq2[K, V]) iter.Seq2[V, K]

Flip takes a sequence 'seq' and returns a new sequence with keys and values flipped.

func Keys

func Keys[K, V any](seq iter.Seq2[K, V]) iter.Seq[K]

Keys takes a sequence 'seq' and returns a new sequence with only the keys from the input sequence.

func Map

func Map[In, Out any](seq iter.Seq[In], fun func(In) (Out, bool)) iter.Seq[Out]

Map applies a function to each element in the input sequence and returns a new sequence with the results.

func Map12

func Map12[In, K, V any](seq iter.Seq[In], fun func(In) (K, V, bool)) iter.Seq2[K, V]

Map12 applies a function to each element in the input sequence and returns a new sequence with the results.

func Map2

func Map2[InKey, InVal, OutKey, OutVal any](seq iter.Seq2[InKey, InVal], fun func(InKey, InVal) (OutKey, OutVal, bool)) iter.Seq2[OutKey, OutVal]

Map2 applies a function to each element in the input sequence and returns a new sequence with the results.

func Map21

func Map21[K, V, Out any](seq iter.Seq2[K, V], fun func(K, V) (Out, bool)) iter.Seq[Out]

Map21 returns a function that applies 'fun' to each element in 'seq' and yields the results based on the provided 'yield' function.

func MapKeys

func MapKeys[K, V any](seq iter.Seq[V], fun func(V) K) iter.Seq2[K, V]

MapKeys returns a function that applies 'fun' to each element in 'seq' and yields the results with keys generated by 'fun'.

func MapValues

func MapValues[K, V any](seq iter.Seq[K], fun func(K) V) iter.Seq2[K, V]

MapValues applies the function 'fun' to each key in the input sequence 'seq' and returns a new sequence with the results where keys and values are flipped.

func Values

func Values[K, V any](seq iter.Seq2[K, V]) iter.Seq[V]

Values takes a sequence 'seq' and returns a new sequence with only the values from the input sequence, discarding the keys.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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