feat: funciones core filter_slice y map_slice

Primeras funciones reales del registry:
- filter_slice: filtra un slice con predicado, pura, generica
- map_slice: transforma cada elemento de un slice, pura, generica
Cada una con implementacion .go, documentacion .md y tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 02:10:38 +01:00
parent b2641796b9
commit 5ef3cda890
7 changed files with 145 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
package core
// MapSlice applies fn to each element of xs and returns a new slice with the results.
// Does not mutate the original slice.
func MapSlice[T any, U any](xs []T, fn func(T) U) []U {
result := make([]U, len(xs))
for i, x := range xs {
result[i] = fn(x)
}
return result
}