4 ms·
I don't know where (or if) |. is documented, I think I saw someone use it in a Github thread somewhere. I use it all the time – for instance someList |
by skosch 8y ago
I don't know where (or if) |. is documented, I think I saw someone use it in a Github thread somewhere. I use it all the time – for instance
someList
|. Belt.List.map(i => i + 1)
... because most Belt.List functions take the list as the first argument, and |> feeds its input as the last argument.
Edit: apparently |. is BuckleScript, lots more discussion here: https://github.com/facebook/reason/issues/1452 https://github.com/facebook/reason/issues/1452 ... just another instance of Reason still finding itself.
- RobertKerans 8y agoAh, that makes sense. But that's, afaics, a completely undocumented operator which breaks standard (subject last) ML convention - I get why it's very useful for interoperability with JS but jeez that isn't great work on the documentation front; I've been using Reason for small personal projects and libraries for the last six months and didn't even know that was a thing that had been defined