Files
fn_registry/functions/core/pipeline.md
T
egutierrez 16e34a806e feat: 6 funciones core — retry, memoize, pipeline, map_concurrent, partition, chunk
Funciones genericas reutilizables:
- RetryWithBackoff: reintento con backoff exponencial (impure)
- Memoize: cache de funciones puras (pure)
- Pipeline: composición T→T en secuencia (pure)
- MapConcurrent: map paralelo con worker pool (impure)
- Partition: divide slice en dos por predicado (pure)
- Chunk: divide slice en trozos de tamaño N (pure)
Todas con implementación real y documentación .md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 02:23:26 +01:00

1006 B

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, 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 tested tests test_file_path file_path
pipeline function go core 1.0.0 pure func Pipeline[T any](fns ...func(T) T) func(T) T Compone funciones T -> T en secuencia de izquierda a derecha. Pipeline(f, g, h)(x) equivale a h(g(f(x))). Sin funciones retorna la identidad.
pipeline
compose
functional
generic
false
false
functions/core/pipeline.go

Ejemplo

transform := Pipeline(
    func(s string) string { return strings.TrimSpace(s) },
    func(s string) string { return strings.ToUpper(s) },
    func(s string) string { return "[" + s + "]" },
)
transform("  hello  ") // "[HELLO]"

Notas

Funcion pura generica. Las funciones se aplican en orden de izquierda a derecha (no es composicion matematica tradicional). Si se pasa un slice vacio de funciones, la funcion retornada actua como identidad.