Productivity means that every finite portion of a potentially infinite result can be computed in finite time. Corecursive functions produce data rather than consume it; unlike ordinary recursion, they need not terminate when each further result remains computable. For LazyList, unfold is productive when its generating function terminates for each requested element. section 5.4 section 5.4
An infinite stream that remains usable
The definition val ones: LazyList[Int] = LazyList.cons(1, ones) does not finish constructing a list. It remains productive because finite demands can be answered: taking five elements yields List(1, 1, 1, 1, 1), and exists can stop after finding an odd element. section 5.4
Practice productivity by:
- Defining fibs, from, continually, and ones with unfold. section 5.4
- Implementing map, take, takeWhile, zipWith, zipAll, startsWith, and hasSubsequence for LazyList. section 5.4



