// 変換 { s := []string{"a", "b", "c"} for v := range it.Map(slices.Values(s), strings.ToUpper) { fmt.Println(v) // A, B, C } } // 集約 { ints := []int{1, 2, 3} sum := it.Fold(slices.Values(ints), op.Add, 0) fmt.Println(sum) // 6 } // 抽出 { ints := []int{1, 2, 3, 4, 5} for i := range it.Filter(slices.Values(ints), filter.IsEven) { fmt.Println(i) // 2, 4 } } } // https://go.dev/play/p/L3lJhX_dnKX