9 ms·
While I like the concept, the side-effect pattern might be difficult for the average developer to understand (without fp-pack knowledge) in a shared codebase:
by eterps 9mo ago
While I like the concept, the side-effect pattern might be difficult for the average developer to understand (without fp-pack knowledge) in a shared codebase:
https://github.com/superlucky84/fp-pack?tab=readme-ov-file#sideeffect-pattern https://github.com/superlucky84/fp-pack?tab=readme-ov-file#s...
Still, this approach is very useful for most business logic, too bad most programming languages don't provide a nice syntax for this.
- superlucky84 9mo agoThat’s a fair point, and I agree. The SideEffect pattern is intentionally explicit, so without fp-pack context it can look unfamiliar at first. The trade-off is making early exits visible in the code, rather than hiding them in conditionals or exceptions. In practice, most code stays in plain pipe/pipeAsync. SideEffect is meant for a small number of boundary cases only. And I agree — better language-level syntax for this kind of pattern would make it much easier to adopt.