Skip to content

L7: Collections and Sequences (Lazy vs Eager)

In this lesson we will explore:

  • Deep Theory: Read-only vs mutable collections (List vs MutableList), functional operations (map, filter, flatMap, reduce, fold), and data streams with Sequence.
  • Under the Hood: Intermediate collection allocation overhead (Eager) vs element-by-element pipeline evaluation without intermediate lists via Sequence (Lazy).
  • Incremental Lab (AI Chat CLI): Developing the message history engine with efficient in-memory pagination and query filtering.