transformops

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterMap

func FilterMap[T any, U any](values []T, fn contracts.FilterMapper[T, U]) []U

FilterMap returns mapped values for inputs accepted by fn while preserving nil input as nil. A nil fn rejects every value.

func IndexBy

func IndexBy[T any, K comparable](values []T, key contracts.Keyer[T, K]) map[K]int

IndexBy builds an index of the first position for each accepted key in values.

func Map

func Map[T any, U any](values []T, fn contracts.Mapper[T, U]) []U

Map returns a slice containing fn applied to each value while preserving nil input as nil. A nil fn returns the zero value for each input element.

Types

This section is empty.

Jump to

Keyboard shortcuts

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