package vex func Map[T, U any](ts []T, f func(T, int) U) []U { us := make([]U, len(ts)) for i := range ts { us[i] = f(ts[i], i) } return us }