513c2fb4a7
Actualiza schema rápido, ejemplo FTS5, sección de añadir funciones y los tres templates (function, pipeline, component) con los campos params/output obligatorios.
1.0 KiB
1.0 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| filter_slice | function | go | core | 1.0.0 | pure | func FilterSlice[T any](xs []T, pred func(T) bool) []T | Filtra un slice aplicando un predicado sin mutar el original. |
|
false |
|
nuevo slice con los elementos que cumplen el predicado | false | functions/core/filter_slice.go |
Ejemplo
evens := FilterSlice([]int{1, 2, 3, 4}, func(n int) bool { return n%2 == 0 })
// evens = [2, 4]
Notas
Funcion pura generica. No muta el slice original — crea uno nuevo.