| 207 | | 2. Record declaration syntax remains exactly the same. |
| 208 | | 3. Works on any function, so it doesn't tie you to the implementation of a record, you can remove a field and add a compatibility shim. So no tension between directly exposing the record implementation vs. writing a bunch of set/modify boilerplate. |
| | 207 | 2. Record declaration syntax remains exactly the same. Totally backward compatible, we can gradually convert existing programs. Even convert an existing record field by field, no need for a single giant patch to update everything at once. |
| | 208 | 3. Works on any function, so it doesn't tie you to the implementation of a record, you can remove a field and add a compatibility shim. So no tension between directly exposing the record implementation vs. writing a bunch of set/modify boilerplate. And it's not just record types, any lens can go in the lens composition, e.g. one for Data.Map. So you can translate imperative `record.a.b[c].d = 42` to `set (#d . Map.lens c . #b . #a) 42 record`. Make a new operator `(%) = flip (.)` if you like left to right. |