Changes between Version 1 and Version 2 of Records/OverloadedRecordFields/Implementation


Ignore:
Timestamp:
Jul 1, 2013 10:17:50 AM (10 months ago)
Author:
adamgundry
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/OverloadedRecordFields/Implementation

    v1 v2  
    2222The `AvailTC` constructor of `Avail.AvailInfo` represents a type and its pieces that are in scope. Record fields are stored in a separate list (rather than bundled in with data constructors and class methods), which contains the `FastString` field name, and perhaps the names of the record selector and dictionary function. 
    2323 
    24 Similarly, the `RdrName.Parent` type has an extra constructor `FldParent` which stores the field name and possibly the selector and dictionary function names. Thus it is easy to tell whether a `RdrName.GlobalRdrElt` (`GRE`) is a field.  
     24Similarly, the `RdrName.Parent` type has an extra constructor `FldParent` which stores the field name (and possibly the dfunid). Thus it is easy to tell whether a `RdrName.GlobalRdrElt` (`GRE`) is a field. In this case, the name of the `GRE` is the selector function. 
    2525 
    2626The `HsExpr.HsExpr` type has an extra constructor `HsOverloadedRecFld FastString`. When `-XOverloadedRecordFields` is enabled, and the renamer encounters `HsVar "x"` where `x` refers to multiple `GRE`s that are all record fields, it replaces it with `HsOverloadedRecFld "x"`. (Is there any reason to treat single record fields differently to other ids?)