Currently, state modules typically look like normal variables (lowercased), and you use their .get or .load methods as appropriate. When unwrapping a state module into its raw value, it can be awkward to decide on what the unwrapped value's variable will be named. This proposal is a possible solution.
This proposal could be supported in a backwards compatible manner by simply defining 0 and 1 on the StateModule object, in addition to the pre-existing get and load methods.
Currently, state modules typically look like normal variables (lowercased), and you use their
.get
or.load
methods as appropriate. When unwrapping a state module into its raw value, it can be awkward to decide on what the unwrapped value's variable will be named. This proposal is a possible solution.With this pattern, the awkwardness is avoided: