Generics, Reflection, and Efficient Collections
summary
Covers concrete patterns for building collection types (array, slice, map, channel), shows runnable examples of user-defined types with range/append/reduce methods, and demonstrates higher-order functions, reflection and generics applied to the same problems. Uses Go’s reflect package to handle arrays of any size and functions-as-sequences but measures a heavy cost — reflection is 20–200× slower — while generics let reduce/iterable signatures be concise and direct — generics make reduce simple. Notes string→rune conversion quirks and when boxing to interface is unavoidable.
AI-written summary · about
chapters (7)
- 0:00Start
- 1:23What Is a Collection
- 3:21User-Defined Types
- 11:28Reflex Api
- 17:56Indexable
- 29:30Reduce Method
- 53:05Custom Functions








