I could certainly try that – It looks like rescript tools is vs-code thing primarily? I use Emacs mostly.
You definitely could do something with a ppx-type thing.
However, doesn’t it seem like it would be a really cool feature to be able to have something that is essentially a record field name, but at the same time a value? To me, it feels like a natural progression – you have union types, you have sum types, now you have something that has a foot in both worlds so to speak.
There are a lot of situations where you might want a pattern-matching function for one thing, and a record/dictionary for another, but have the same keys. At the end of the day a pattern matching clause looks a lot like a hashmap where the keys are the domain of the function and the range are the values. If I’m not mistaken a lot of languages implement pattern matching using just such a datastructure. Why not double down on that relationship? 