5f4f1f7508
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
975 B
975 B
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 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| reduce | function | go | core | 1.0.0 | pure | func Reduce[T, U any](slice []T, initial U, f func(U, T) U) U | Reduce un slice a un unico valor aplicando una funcion acumuladora de izquierda a derecha. |
|
false |
|
valor final del acumulador después de procesar todos los elementos | false | functions/core/reduce.go |
Ejemplo
sum := Reduce([]int{1, 2, 3, 4}, 0, func(acc, x int) int { return acc + x })
// sum = 10
Notas
Funcion pura generica. Implementacion en devfactory/core.