ReScript is the first language I’ve used that has pipe first so my instinct is to use |>. When the function is unary, it works just as well.
Let’s imagine a scenario where Promise.Js.fromBsPromise takes two argument and the promise is the second argument. That would point me to using |> instead of -> to use that function. Then after that, what would I do to be able to use -> to leverage Proimse.Js.map after that?
They are not exactly the same.The → operator is completely desugared on the syntax level, the |> is a normal infix operator function call that happens to get optimized by the compiler later on (that’s why you won’t notice any difference in the JS output).