package main

import (
	"fmt"
	"maps"
	"slices"
)

func main() {
	// section: example
	existing := []string{"existing1", "existing2"}

	m := map[string]int{
		"new1": 1,
		"new2": 2,
	}

	// AppendSeq appends values from an iterator to an existing slice
	combined := slices.AppendSeq(existing, maps.Keys(m))
	slices.Sort(combined) // Sort for consistent output
	fmt.Println("Combined:", combined)

	// Unlike Collect, AppendSeq preserves existing elements
	// This is useful when building up a slice incrementally
	// section: example
}
