Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsFilter ¶ added in v0.1.1
func AsFilter[T any](f funcs.FilterFunc[T]) funcs.FilterFunc[T]
AsFilter converts a function conforming to the [FilterFunc] signature to a [FilterFunc] type.
func AsFilterPair ¶ added in v0.1.1
func AsFilterPair[K any, V any](f funcs.FilterPairFunc[K, V]) funcs.FilterPairFunc[K, V]
AsFilterPair converts a function conforming to the [FilterPairFunc] signature to a [FilterPairFunc] type.
Types ¶
type Pair ¶ added in v0.1.0
Pair is a simple interface for key-value pairs. It is used to represent key-value pairs in a way that can be used with functions expecting the Seq type.
type Seq ¶
Seq is a new type for iter.Seq that provides functional easy access to other functions of the functional package as methods that can be easily chained together.
func Concat ¶ added in v0.1.2
Concat concatenates the provided sequences into a single sequence. This function does return elements in order, starting with the first element of the first sequence and ending with the last element of the last sequence. This does not guarantee that the underlying sequences give a predictable order.
func Map ¶
Map applies the provided function to each element of the input sequence, returning a new sequence containing the resulting values.
func OfSlice ¶ added in v0.1.0
OfSlice converts a slice to a Seq for use with the functional package.
func (Seq[T]) Collect ¶
func (s Seq[T]) Collect() []T
Collect returns the elements of the sequence as a slice.
type Seq2 ¶
type Seq2[K comparable, V any] iter.Seq2[K, V]
Seq2 is a new type for iter.Seq2 that provides functional easy access to other functions of the functional package as methods that can be easily chained together.
func OfPairSeq ¶ added in v0.1.0
OfPairSeq casts a Seq of key-value pairs to a Seq2 for use with the functional package.
func OfSeq2 ¶
func OfSeq2[K comparable, V any](seq iter.Seq2[K, V]) Seq2[K, V]
OfSeq2 casts an iter.Seq2 to a Seq2 for use with the functional package.
func (Seq2[K, V]) AsSeq ¶ added in v0.1.0
AsSeq converts a Seq2 to a Seq of key-value pairs implementing the Pair interface
func (Seq2[K, V]) Collect ¶
func (s Seq2[K, V]) Collect() map[K]V
Collect returns the elements of the sequence as a map.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package filter provides support for filtering sequences
|
Package filter provides support for filtering sequences |
|
Package funcs contains type-definitions and helpers for functions that this module accepts as parameters
|
Package funcs contains type-definitions and helpers for functions that this module accepts as parameters |