Changes between Version 29 and Version 30 of Records/DeclaredOverloadedRecordFields


Ignore:
Timestamp:
Mar 12, 2012 2:31:39 AM (2 years ago)
Author:
AntC
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields

    v29 v30  
    2121=== Implementation: the `Has` class, with methods `get` and `set` === 
    2222 
    23 Record declarations generate a `Has` instance for each record type/field combination. As well as type arguments for the record and field, there is a third argument for the field's resulting type. This is set at the instance level using equality constraints in a functional-dependencies style. Here is the `Has` class (`r` is the record, `fld` is the proxy type for the field, `t` is the fields type), with an example record declaration, its `Has` instance, and examples of use: 
     23Record declarations generate a `Has` instance for each record type/field combination. As well as type arguments for the record and field, there is a third argument for the field's resulting type. This is set at the instance level using equality constraints in a functional-dependencies style. Here is the `Has` class (`r` is the record, `fld` is the proxy type for the field, `t` is the field's type), with an example record declaration, its `Has` instance, and examples of use: 
    2424{{{ 
    2525    class Has r fld t                                             where 
     
    7373 * `Has` uses type family functions to manage type-changing update, which adds complexity -- see Implementer's view. 
    7474 * Multiple fields can be updated in a single expression (using familiar H98 syntax), but this desugars to nested updates, which is inefficient. 
    75  * Pattern matching and record creation using the data constructor prefixed to { ... } work as per H98 (using DisambiguateRecordFields and friends). 
     75 * Pattern matching and record creation using the data constructor prefixed to { ... } work as per H98 (using `DisambiguateRecordFields` and friends). 
    7676 
    7777.