In this video, I show how DIVEX and Composition Language 1 can be used to compose potentially-pure functions.
A potentially-pure function is a function whose body is pure but that calls functions passed as parameters. Depending on the purity of passed functions, a potentially-pure function may be pure or impure.
Composing potentially-pure functions using DIVEX is great because it allows delaying the injection of impure dependencies to the last possible moment.
You can try this example in the browser here:
https://divex.dev/try-in-the-browser-cscompose/?sample=ComposePotentiallyPureFunctions
Read more about this topic:
https://divex.dev/knowledge-base/main/dependency-injection-can-be-functional/