0PricingLogin
Dart Academy · Lesson

Lazy Iterables and Generators With sync*

Produce values on demand.

What Lazy Means

A lazy iterable does not compute its values until you actually ask for them. Work happens on demand, not all at once. 🦥

Iterables Are Lazy

Methods like map and where return a lazy Iterable. Nothing runs until you iterate or call toList.

var it = [1, 2, 3].map((n) {
  print('seen $n');
  return n * 2;
});

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