Add sugar for dereferencing
happened to write a heavily mutable code and using .contents everywhere was a pain.
a sugar like ml's ^ makes reading and writing mutable code with refs much easier
Not sure I understand correctly.
If you mean ! in OCaml for dereferencing of ref, I think the operators for deref and mutate functions are needed in the syntax layer.
let foo = ref("")
let deref = r => r.contents // `!` in OCaml
let mutate = (r, value) => r.contents = value // `:=` in OCaml
let bar = ^foo // deref(foo)
let baz = foo := "baz" // mutate(foo, "baz")
// `^` and `:=` are just examples.
yes.
:= is available today
The rescript-lang/syntax repo is obsolete and will be archived soon. If this issue is still relevant, please reopen in the compiler repo (https://github.com/rescript-lang/rescript-compiler) or comment here to ask for it to be moved. Thank you for your contributions.