Changes between Version 49 and Version 50 of Records


Ignore:
Timestamp:
Feb 23, 2012 12:14:33 AM (2 years ago)
Author:
GregWeber
Comment:

compare overloading more

Legend:

Unmodified
Added
Removed
Modified
  • Records

    v49 v50  
    7272With other approaches (including TDNR) this will fail to type check unless the compiler can determine the type of r is either `Record` or `RecordClash`. Note that we already can accomplish this on an opt-in basis with Type Classes: making this automatic is not required and could give the unwary user weakly-typed code. 
    7373 
    74 The advantage of Namespacing is that the implementation is clear, straightforward, and has already been done in Agda and Frege. We can either stop with name-spacing (Agda) or continue on with automatically resolving the field when the dot operator is used. Overloading has seen downsides in practice. In the words of the Frege author, who abandoned Overloading: 
     74The advantage of Namespacing is that the implementation is clear, straightforward, and has already been done in Agda and Frege. We can either stop with name-spacing (Agda) or continue on with automatically resolving the field when the dot operator is used. Overloading has seen downsides in practice. In the words of the Frege author, who abandoned Overloading with abstraction over field names: 
    7575 
    7676    * only very inefficient code could be generated, if you have to access or update a field of some unknown record. In the end, every record type was basically a map. 
     
    7878    * the extra constraints complicated the type checker and did not play well with higher kinded type variables (at least in the code I had then, I do not claim that this is nessecarily so). 
    7979 
    80  
     80Overloading without abstraction over fields may be able to avoid some of these potential downsides, and a judicious (no virtual fields, etc) implementation of either could look very similar to the programmer. 
    8181 
    8282=== Type directed name resolution ===