reasonml / reason

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems
http://reasonml.github.io
MIT License
10.08k stars 425 forks source link

Processing of `;%lwt` #2355

Open Lupus opened 5 years ago

Lupus commented 5 years ago

I've stumbled across Lwt documentation which states the following:

With OCaml 4.04.0 and on a convenient syntax is available for sequencing Lwt operations using ;%lwt. This allows free mixing of standard ; sequencing and ;%lwt sequencing without extra parentheses

I've tired it, it did not work with Lwt as I expected, I've started an issue on that in Lwt repo and got the following input (by @hcarty):

Reason doesn't have proper ;%lwt support in its parser, so it ends up mis-applied to the surrounding code. So while ;%lwt works properly in OCaml code, it doesn't do what you'd expect in Reason.

Looks like this was not reported previously, hence this feature request issue. Is it possible to introduce proper support for monadic semicolons? Current behaviour when it seemingly works but does the wrong thing is quite counter-intuitive :)

jordwalke commented 3 years ago

Thanks for reporting this one.