This syntax would be very useful—is there a reason for this not working? Thanks!
module Foo = {
let bar: string = "bar"
};
let bar = Foo.bar; /* works */
let { bar } = Foo; /* Unbound record field bar */
Try it online!
The closest you can do is something like this:
module Foo = {
let bar = "bar";
let baz = "baz";
};
let (bar, baz) = Foo.(bar, baz);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With