But you can already pipe all relevant coroutine and sequence operations in Kotlin without any special piping operator. This is made possible by extension functions in Kotlin. All the “pipeable” functions in Kotlin idiomatic code are defined as extensions, so you can write s.filter { ... }.map { ... }
as a pipeline. Only languages that lack the concept of “extension function” need piping operator to turn regular (non-extension) filter
, map
, etc functions into a pipeline-looking style.
3 Likes