News for hackers. Stuff that matters.
Re:ReasonML – React as first intended by RobertKerans on Thursday May 24, 2018 @07:07PM (#17149304)
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
Re:ReasonML – React as first intended by skosch on Friday May 25, 2018 @09:57AM (#17153726)
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 ... just another instance of Reason still finding itself.

Re:ReasonML – React as first intended by RobertKerans on Saturday May 26, 2018 @08:30PM (#17164890)
Ah, 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