Another sequence operation that can involve significant overhead is distinct (or distinctBy), which involves a Set internally.
Such operations can be described as stateful, as they retain state regarding earlier elements that is used when processing a given element (and therefore trigger consumption of the source of the sequence and potentially involve internal overhead). Stateless operations can process elements without regard to the number or value of any earlier elements (and therefore do not trigger consumption of the source of the sequence and do not involve significant internal overhead).
In the official documentation for the java stream APIs, all intermediate operations are categorised as stateful or stateless. This categorisation is important for the developer because it indicates whether the operation is cheap or potentially expensive (especially if the stream is being processed in parallel). This documentation also defines intermediate vs terminal operations, stateful vs stateless intermediate operations and the significant of them.
It is perhaps worth noting that the JDK 8 design includes stateful intermediate operations that return streams (similar to the design decision in kotlin to include stateful intermediate operations that return a sequence).
Could something similar be added to the documentation for the kotlin.sequences package?
For example, definitions of intermediate vs terminal operations and stateful vs stateless intermediate operations (as well as indicating in the method level documentation what type each operation is).