Pipelines and Composition
In this chapter, we will combine all knowledge from previous chapters and first discuss function composition, which allows us to combine simple functions to create more complex operations. Then, we will see how to construct pipelines using the Pipe
method. We will also recall how to create monadic pipelines that gracefully handle errors. Furthermore, the fluent interface technique, which helps to write code that can be read almost like regular text, will be presented.
To sum it up, this chapter walks us through these topics:
- Function composition
- Building pipelines
- The fluent interface
- Advanced composition with monads
I could not betray our tradition and, for the last time, prepared three self-check tasks for you.