Hacker News new | past | comments | ask | show | jobs | submit login

What's wrong with a pipeline operator? JS is getting one as well.

https://github.com/tc39/proposal-pipeline-operator

Chaining calls in JS means that a function returns the original object, piping is actually passing over the result as an argument, so it's semantically different.




> What's wrong with a pipeline operator?

Honestly, for the use case, the same thing that's wrong with a (mandatory) visible function application operator in Haskell.

> Chaining calls in JS means that a function returns the original object, piping is actually passing over the result as an argument, so it's semantically different.

The syntax Flux uses for creating the result is the same as JS would use for mutating an inbound object, so it actually would be consistent if pushing the result used the same syntax as passing the (mutated) original object would in JS.

Though I’d prefer whitespace for piping just like Haskell does for application. If your are going to specialize a language for a domain, don't be timid about it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: