Browse Learn Clojure Foundations as a Java Developer

Core Higher-Order Functions in Clojure

Learn the everyday Clojure tools for transformation, selection, aggregation, concrete collection output, composition, and specialization.

Most Clojure code is built from a small toolkit of higher-order functions. If you learn these well, you can read a large percentage of real codebases without feeling lost.

The core set to internalize

  • map, filter, remove, keep for sequence transformations.
  • reduce when you need to combine a sequence into a single result.
  • into when you want a concrete collection at the end of a pipeline.
  • comp and partial for composition and specialization.

Java mental model: similar to the core Stream operators, but these functions are used everywhere, not only in a “stream” context.

In this section, focus on reading: given a pipeline, can you say what value flows between steps and what type of thing comes out at the end?

In this section

  • Using map for Transformation
    Learn when map is the right Clojure tool, how it differs from Java loop and stream habits, and how to use it clearly with single and multiple collections.
  • Aggregating Data with reduce
    Learn how reduce combines a collection into one result, how to choose the right accumulator shape, and how it differs from loops and stream reduction in Java.
  • Filtering Collections with filter
    Learn how filter keeps matching items in a Clojure pipeline, how laziness affects it, and how it differs from Java loops and stream filtering.
Revised on Saturday, May 23, 2026