Wrapping Up
In this chapter, we concentrated entirely on implementing the steps in the pipeline and working with dependencies. The implementation for each step was narrowly focused on doing just one incremental transformation and was easy to reason about and test in isolation.
When it came time to compose the steps, the types didn’t always match up, so we introduced three important functional programming techniques:
-
Using an “adapter function” to transform a function from one “shape” to a different shape—in this case, to change the output of checkProductCodeExists from a bool to a ProductCode
-
“Lifting” disparate types into a common type, as we did with the events, converting them all to the common PlaceOrderEvent type
-
Using partial application ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access