3 ms·
Yea, thays been very much my experience as well. Still a little bit off usable imo, docs are still very iffy, and there's only really Real World OCaml as a grea
by RobertKerans 8y ago
Yea, thays been very much my experience as well. Still a little bit off usable imo, docs are still very iffy, and there's only really Real World OCaml as a great learning resource for the actual language.
refmt formatting drives me a bit nuts, especially the.lines thing; it's steadily improving though.
One thing though - Belt is the WIP standard library (so OCaml), whereas JS is just bindings to JS, they're very different things. Belt produces much better JS when transpiled, and it seems a lot saner than the stdlib, but it isn't really anything to do with JS bindings.
And the pipe operator is |>, afaics |. is a typo on the Promises documentation page?
|> for reverse application, @@ for application, so
foo |> bar |> baz
and
baz @@ bar @@ foo
are both the same as
baz(bar(foo))
and they work excatly the same as in other ML languages
- skosch 8y agoI 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