Changes between Version 7 and Version 8 of Records/OverloadedRecordFields
- Timestamp:
- 12/28/11 18:17:38 (18 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Records/OverloadedRecordFields
v7 v8 5 5 idea there are numerous ramifications. Records are a swamp! 6 6 7 See also a similar [http://research.microsoft.com/en-us/um/people/simonpj/Haskell/records.html 2003 proposal by Simon PJ and Greg Morrisset]. It is essentially the same as the proposal below, but (a) has less detail and (b) adds anonymous rec cord types. Anonymous type could be an add-on feature to the design described here.7 See also a similar [http://research.microsoft.com/en-us/um/people/simonpj/Haskell/records.html 2003 proposal by Simon PJ and Greg Morrisset]. It is essentially the same as the proposal below, but (a) has less detail and (b) adds anonymous record types. Anonymous type could be an add-on feature to the design described here. 8 8 9 9 = The base design = 10 10 11 The '''base design''' has the foll lowing distinct components:11 The '''base design''' has the following distinct components: 12 12 13 13 * A library class … … 326 326 will be rejected because `rv` is not polymorphic. Again, this is '''not''' easy to fix. 327 327 328 This problem seems to be a killer: if record-update syntax is interpre sted as a call to `set`, we cannot, ever, use record-update syntax to update a record with a polymorphic field. (We could use alternative notation; instead of `r { rev = reverse }` we could say328 This problem seems to be a killer: if record-update syntax is interpreted as a call to `set`, we cannot, ever, use record-update syntax to update a record with a polymorphic field. (We could use alternative notation; instead of `r { rev = reverse }` we could say 329 329 {{{ 330 330 case r of { HR { .. } -> HR { rev = reverse, .. } } … … 335 335 another alternative is to stick with the status quo for record 336 336 updates; that is, not to support any sort of overloading. But even 337 ''that'' is problema ntic: what does `e { x = True }` mean if there are lots of "x" fields337 ''that'' is problematic: what does `e { x = True }` mean if there are lots of "x" fields 338 338 in scope (which is precisely what we want to allow). Haskell's current record-update 339 339 syntax really relies on learning which type is involved, from the record selector; but if
