Hacker News new | ask | show | jobs
by semicolon_storm 1412 days ago
Some domains require horribly complicated code that I’m perfectly happy admitting that I’ll never understand it. Chaining function calls is not one of those domains.

I suppose I don’t really care, it’s not my library and I’ll never use it, it’s just interesting to see how differently styled it is.

1 comments

Chaining functions _does_ need this though, in current Typescript. The pipe function has to enforce some really complex constraints (inner types between siblings/fn args). There's really no other "correct" way to write this without calling it a day and just doing a generic for different amount of args (<A>, <A, B>, <A, B, C>, etc).

I agree it's complex, but necessary for a utility like this if you want correctness for arbitrary N args