Backporting let+ syntax to BuckleScript using Dune's ocaml-syntax-shims?

bsb

#1

OCaml 4.08 is adding a new let+ syntax which is really useful when writing monadic-style code (PR). The Dune authors wrote a syntax shim to add support for the syntax for OCaml >= 4.02 (announcement, code). Is there any plan or interest in adding this to BuckleScript before BuckleScript is upgraded to OCaml 4.08 (which is probably going to happen several months after 4.08 final is out)?


#2

I proposed this here: https://github.com/BuckleScript/bucklescript/issues/1326

This would be really good to have imho :slight_smile:


#3

Awesome! I just added the 7th :+1: on the comment. I hope Bob considers this. I’d love to use it with a Promise wrapper.


#4

That’d be awesome, current use of promises is a bit clumsy, this let+ syntax is very clear and would definitely solve the promise issue (plus tons of other use cases for monads)