Live data from Hacker News

Show HN: FP-pack – Functional pipelines in TypeScript without monads

github.com

11–17 of 17 posts

Re: Show HN: FP-pack – Functional pipelines in TypeScript without monads

#12

Every time I introduce something like this teams complain. RX is a brain antipattern

I really relate to that.

There’s often a gap between what feels conceptually clean and what teams are actually willing to carry cognitively. Rx in particular tends to exceed that budget pretty quickly.

That’s why fp-pack is intentionally narrow — it’s closer to making a few control-flow cases explicit in pipe-first code than introducing a broad new abstraction.

Re: Show HN: FP-pack – Functional pipelines in TypeScript without monads

#14
post #13

Haskell does not have nulls. Java 8 introduced Options, and now there are nulls and Options. Please tell me you didn't just add SideEffects to a language full of side-effects.

I understand the concern.

The intent isn’t to add more side effects to an already side-effectful language. It’s closer to the opposite: trying not to handle side effects all over the place, but to surface them as part of a single, explicit flow.

This is less about adding something like Option to a language without nulls, and more about making control-flow boundaries visible in a multi-paradigm language where effects already exist.

It’s not an attempt to pretend the language is pure, just a small step toward more declarative discipline.

Re: Show HN: FP-pack – Functional pipelines in TypeScript without monads

#15
post #3

How is this not a monad? It might be trying really hard not to reify the core concept of a monad, but it seems to me like it ends up being essentially a complicated monad.

It’s definitely monad-adjacent. The main difference is that SideEffect isn’t a compositional context — there’s no bind/flatMap, and composition intentionally stops once it appears. It’s meant as an explicit early-exit signal in pipe-first code, not a general computation container.

Is there any advantage whatsoever to this, as opposed to a proper monad? I’m not seeing it.

The point of monads is that they solve this exact category of problem in the simplest possible way.

Re: Show HN: FP-pack – Functional pipelines in TypeScript without monads

#16
post #15

Earlier quoted context omitted.

It’s definitely monad-adjacent. The main difference is that SideEffect isn’t a compositional context — there’s no bind/flatMap, and composition intentionally stops once it appears. It’s meant as an explicit early-exit signal in pipe-first code, not a general computation container.

Is there any advantage whatsoever to this, as opposed to a proper monad? I’m not seeing it. The point of monads is that they solve this exact category of problem in the simplest possible way.

One more practical point is that a full monad doesn’t fit very naturally into a pipe-first interface.

Once you commit to a real monad, you need map/flatMap, lifting, unwrapping, and rules about staying inside the context across the whole pipeline. At that point, the pipe abstraction stops being the primary mental model — the monad does.

SideEffect deliberately avoids that. It keeps the pipe interface intact and only adds a single, explicit signal: “stop here”. That’s why it’s less powerful than a monad, but also much simpler to integrate into existing pipe-based code.

Re: Show HN: FP-pack – Functional pipelines in TypeScript without monads

#17
post #15

Earlier quoted context omitted.

It’s definitely monad-adjacent. The main difference is that SideEffect isn’t a compositional context — there’s no bind/flatMap, and composition intentionally stops once it appears. It’s meant as an explicit early-exit signal in pipe-first code, not a general computation container.

Is there any advantage whatsoever to this, as opposed to a proper monad? I’m not seeing it. The point of monads is that they solve this exact category of problem in the simplest possible way.

fp-pack is also intentionally scoped for everyday frontend developers.

It tries to borrow function composition and declarative structure without requiring familiarity with full FP abstractions like monads or effect systems.

Post reply on HN