All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Initial release.
Find[T any](s []T, pred func(T) bool) (T, bool)— first matching element, returns value + boolFilter[T any](s []T, pred func(T) bool) []T— new slice of matching elements, non-mutatingGroupBy[T any, K comparable](s []T, keyFn func(T) K) map[K][]T— group slice elements by keyKeyBy[T any, K comparable](s []T, keyFn func(T) K) map[K]T— index slice elements by key (last-wins)Partition[T any](s []T, pred func(T) bool) (matched, unmatched []T)— split by predicate in one passCount[T any](s []T, pred func(T) bool) int— count matching elementsEvery[T any](s []T, pred func(T) bool) bool— all-match with short-circuit (vacuously true for empty)- Adversarial test coverage verifying nil-return guarantees, immutability, result non-aliasing, custom comparable key types, struct keys, stateful predicates, and short-circuit evaluation
- Integration tests mirroring real-world patterns (find-by-ID, log analysis, role grouping)
- 100% test coverage
- Zero external dependencies — pure stdlib
- No
Map,Reduce,Fold, orFlatMap— use a Go for-loop - No
FindIndex— stdlibslices.IndexFunccovers this - No
Any— stdlibslices.ContainsFunccovers this - No set operations (those live in
bold-minds/list) - No iterator (
iter.Seq) support in v1 — works on[]Tonly - No in-place mutation — every function is non-mutating
- Go 1.21 or later