reasonml-q-a icon indicating copy to clipboard operation
reasonml-q-a copied to clipboard

What's the difference between pipe-first and pipe-last?

Open baransu opened this issue 4 years ago • 2 comments

Question

Offical doumentation mentions only pipe-first (->). It's only available when using together with BuckleScript and doesn't exist in native or js_of_ocaml. Belt (BuckleScript standard library) is pipe-first optimized but Reason Perversives are pipe-last (|>) optimized as well as whole Js.* namespace. What are the pros and then cons of using pipe-first over pipe-last and when one should use which?

Answer

This question hasn't been answered yet.

Further reading

baransu avatar Feb 15 '20 20:02 baransu

I think we have a great answer to this one.

yawaramin avatar Feb 18 '20 02:02 yawaramin

https://github.com/tc39/proposal-pipeline-operator/issues/143#issuecomment-492019845

Try to use pipe first as much as possible.

chenglou avatar Feb 18 '20 23:02 chenglou