zth / reasonml-q-a

ReasonML Q & A - Questions and answers for everything ReasonML.
https://reasonml-q-a.netlify.com
44 stars 0 forks source link

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

Open baransu opened 4 years ago

baransu commented 4 years ago

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

yawaramin commented 4 years ago

I think we have a great answer to this one.

chenglou commented 4 years ago

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

Try to use pipe first as much as possible.