15 Stream processing and incremental I/O
This chapter covers
- Shortcomings of imperative IO
- Transformation using stream transducers
- Building an extensible
Process
type - Single input and output processing with
Source
andSink
- Combining multiple input streams using
Tee
We said in the introduction to part 4 that functional programming is a complete paradigm. Every imaginable program can be expressed functionally, including programs that interact with the external world. But it would be disappointing if the IO
type were the only way to construct such programs. IO
and ST
work by simply embedding an imperative programming language into the purely functional subset of features that we have explored up to now. While programming within the IO
monad, ...
Get Functional Programming in Kotlin now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.