package utils type Mapper[T, R any] func(T) R func MapSlice[T, R any](input []T, mapper Mapper[T, R]) []R { output := make([]R, len(input)) for i := range input { output[i] = mapper(input[i]) } return output }