Another pipe operator, the fast pipe `|.`
Reasonml has a pipe operator |>
that places a value into the first positional argument, like so:
> let result = 4 |> String.sub("abcdefg", 1)
"bcde"
This is different than the same operator in Elixir, but I get it. I just learned however that Reasonml has another pipe operator, the fast pipe |.
that places the value into the first argument of the function, like this:
> let result = "abcdefg" |. String.sub(2, 4)
"cdef"
This seems to be evolving functionality with some special cases that you can learn more about in the bucklescript docs.
Tweet