#reduce Clear
Tags #php #kotlin #bash #go #sql #rust #typescript #html #java #python #files #utils #strings #http #concurrency #async #json #arrays #security #types #crypto #database #dates #format
Kotlin map / filter / reduce
The three classic functional combinators. Each takes a lambda and returns a new collection (or a single value for reduce). Chain freely — intermediate allocations only matter at very large scale (use `Sequence` then).
Rust fold / reduce / scan
`fold` is the general aggregator: starts from an accumulator, applies a fn to each item. `reduce` uses the first item as the seed. `scan` yields intermediate accumulator values.
Go Generic Map / Filter / Reduce
Three classic functional combinators, generically typed. Go's standard library doesn't ship these (yet), but they're short enough to drop into any project.
Java Stream.reduce — Aggregate to a Single Value
`reduce` collapses a stream to one value: sum, product, max, min, custom accumulation. Two-arg form needs an identity (zero/seed); three-arg form supports parallel streams via a combiner.