Composing effectful operations can be of many types. If you want fail-fast composition, then you need to go for monadic ones. You can have each of your functions return the monad of your choice (e.g., Either). Then you can use for-comprehensions to compose them. If you want to have fail-slow composition, you can choose the applicative model. Validation is one such abstraction which lets you compose multiple operations with error accumulation.

(D. Ghosh)