Documentation
¶
Overview ¶
Package helpers provides helper functions for testing.
Index ¶
- func FlattenPairs[V any](pairs iter.Seq2[V, V]) iter.Seq[V]
- func Limit[V any](n int, values iter.Seq[V]) iter.Seq[V]
- func LimitPairs[V1, V2 any](n int, values iter.Seq2[V1, V2]) iter.Seq2[V1, V2]
- func PairFold[V1, V2 any](pairs iter.Seq2[V1, V2]) iter.Seq[Pair[V1, V2]]
- func Swap[V1, V2 any](pairs iter.Seq2[V1, V2]) iter.Seq2[V2, V1]
- func ToPairs[V, R1, R2 any, F ~func(V) (R1, R2)](values iter.Seq[V], f F) iter.Seq2[R1, R2]
- type Pair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FlattenPairs ¶
FlattenPairs returns an iterator that yields values by flattening pairs.
func LimitPairs ¶
LimitPairs returns an iterator sequence that yields at most n pairs.
func PairFold ¶ added in v0.4.0
PairFold returns an iterator that transforms pairs to a sequence of [Pair]s.
Types ¶
type Pair ¶ added in v0.4.0
type Pair[V1, V2 any] struct { V1 V1 V2 V2 }
Pair is a pair of values.
func CollectPairs ¶ added in v0.4.0
CollectPairs returns a slice of pairs collected from the given iterator.
Click to show internal directories.
Click to hide internal directories.