0Pricing
Dart Academy · Lesson

Composing Pure Function Pipelines

Chain transformations predictably.

What Is a Pure Function

A pure function returns the same output for the same input and changes nothing outside itself. Predictable and easy to test. ✨

int double(int x) => x * 2; // pure

Spotting Side Effects

A function with side effects touches the outside world, like printing or mutating a global. Those are harder to reason about.

var log = [];
void impure(int x) => log.add(x); // side effect

All lessons in this course

  1. Higher-Order Functions and Currying
  2. fold, reduce, and expand
  3. Lazy Iterables and Generators With sync*
  4. Composing Pure Function Pipelines
← Back to Dart Academy