reasonml-q-a
reasonml-q-a copied to clipboard
What's the difference between pipe-first and pipe-last?
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
I think we have a great answer to this one.
https://github.com/tc39/proposal-pipeline-operator/issues/143#issuecomment-492019845
Try to use pipe first as much as possible.