I built fp-pack, a small TypeScript functional utility library focused on pipe-first composition.
The goal is to keep pipelines simple and readable, while still supporting early exits and side effects — without introducing monads like Option or Either.
Most code uses plain pipe/pipeAsync. For the few cases that need early termination, fp-pack provides a SideEffect-based pipeline that short-circuits safely.
I also wrote an “AI agent skills” document to help LLMs generate consistent fp-pack-style code.
Feedback, criticism, or questions are very welcome.
superlucky84•1d ago
It’s intentionally not a monad, and I’m curious how others feel about this trade-off compared to Option/Either in real-world TypeScript codebases.
cobbal•1d ago
superlucky84•1d ago
Early termination is the most common use case, but it’s not the only thing SideEffect represents. The name is intentionally a bit broader — it’s meant to model “effects where normal composition should stop”.
In practice, that includes things like validation failures, logging or notifications at pipeline boundaries, and error reporting or metrics. That said, the scope is deliberately conservative.
SideEffect isn’t meant to be a general-purpose effect system. If it were, it would quickly turn into something very close to a monad or effect framework, which I’m intentionally avoiding.