| 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. |
| 209 | | 4. Module export list controls access over record fields as always. |
| 210 | | 5. Orthogonal to records: any function can be addressed. |
| | 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. |
| | 209 | 4. 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. |
| | 210 | 5. Module export list controls access over record fields as always. |
| | 211 | 6. Orthogonal to records: any function can be addressed. |