Changes between Version 39 and Version 40 of Records/OverloadedRecordFields/Implementation


Ignore:
Timestamp:
Aug 14, 2013 10:50:55 AM (20 months ago)
Author:
adamgundry
Comment:

data families with duplicated fields

Legend:

Unmodified
Added
Removed
Modified
  • Records/OverloadedRecordFields/Implementation

    v39 v40  
    189189However, what can we call the record selectors? They can't both be `$sel_foo_F`! Ideally we would use the name of the representation tycon, rather than the family tycon, but that isn't introduced until the typechecker (`tcDataFamInstDecl` in `TcInstDcls`), and we need to create the selector in the renamer (`getLocalNonValBinders` in `RnNames`). We can't just pick an arbitrary unique name, because we need to look up the selector to associate it with its data constructor (`extendRecordFieldEnv` in `RnSource`). 
    190190 
     191For the moment, I've simply disallowed duplicate fields for a single data family in a single module. It's fine to duplicate fields between different data families or across different modules, however. 
     192 
    191193 
    192194== Qualified names == 
     
    229231== To do == 
    230232 
    231 * Sort out data families with duplicated fields. 
    232233* Improve error messages from typechecker: 
    233234  * Unsolved `Accessor p f` where `p` is something silly