Changes between Version 14 and Version 15 of Records/SyntaxDirectedNameResolution
- Feb 28, 2012 12:27:15 AM (2 years ago)
v14 v15 207 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 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 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 210 5. Module export list controls access over record fields as always. 211 211 6. Orthogonal to records: any function can be addressed.