To get a transparent support of Js.Promise.t<result<...>> and other arbitrary monadic types we would have to loose native async / await output. I think it’s a very good decision to make it work exactly as in JavaScript.
A “do” notation probably can be considered later as a separate feature. To me personally it would be a “fun to have”, while the lack of async / await is a limitation that I feel day to day when working with asynchronous code.
Do you spend a lot of time in your generated javascript?
We’re stuck with it without sourcemaps i guess, but otherwise, I’m particularly not interested in which syntax my generated code uses. // Generated by ReScript, PLEASE EDIT WITH CARE.
I tend to be in generated JS often whenever I’ve tried to introduce rescript to any team. But that’s to validate that my bindings are correct, as well as show how easy it is to remove rescript if it doesn’t pan out.
One of the largest impediments has been no async await. So this is a big win!
Woah that’s sweet. I can’t recall at all if Typescript has an option to enforce exception checks, or if it’s even possible, especially knowing that OCaml 5 hasn’t even implemented it.
Can this behaviour be disabled? For example when I want to panic, I don’t care what type of exception can be thrown. And when it’s an error flow, I think it’s better to use Result.t
That will be V10.1 which is a big-ish step w.r.t. 10.0 in terms of functionality, but a relatively small step in terms of risk as features are already relatively well tested in there, so the 10.1 release could follow e.g. 2 or 3 months after 10.0 if no surprising issues are discovered.
The split between 10.0 an 10.1 is mostly about risk management, where the former contains mostly the fixes and the latter mostly the novelties, in the past year or so.