Changes between Version 4 and Version 5 of Records/DeclaredOverloadedRecordFields/ImplementorsView


Ignore:
Timestamp:
Feb 17, 2012 11:43:49 PM (3 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields/ImplementorsView

    v4 v5  
    1212DORF is to be enabled by a compiler flag '''‑XDeclaredOverloadedRecordFields''', which implies flag '''‑XNoMonoRecordFields''', which in turn implies ‑XDisambiguateRecordFields and -XNamedFieldPuns with ‑XRecordWildCards. 
    1313 
    14 Note we do _not_ assume flag ‑XDotPostfixFuncApply; dot notation is not needed by DORF, it's purely syntactic sugar to suit the taste of the programmer. 
    15  
    16 DORF is implemented through a class `Has' with methods `get' and `set'. (Very similar in principle to SORF.) There's an instance of `Has' for each record/field combination, with the instance generated from the record declaration. 
    17  
    18 Within each instance, get/set are defined in terms of the record's data constructors, using ‑XDisambiguateRecordFields and friends. 
    19  
    20  
    21 fieldLabel declaration (data dictionary) 
     14Note we do __not__ assume flag ‑XDotPostfixFuncApply; dot notation is not needed by DORF, it's purely syntactic sugar to suit the taste of the programmer. 
     15 
     16DORF is implemented through a class `Has` with methods `get` and `set`. (Very similar in principle to SORF.) There's an instance of `Has` for each record/field combination, with the instance generated from the record declaration. 
     17 
     18Within each instance, `get/set` are defined in terms of the record's data constructors, using ‑XDisambiguateRecordFields and friends. 
     19 
     20 
     21=== fieldLabel declaration (data dictionary) === 
    2222 
    2323There is to be a new declaration type, examples: 
     
    2929[`fieldLabel` is rather long as reserved words go. I'm guessing that field or label would already be heavily used in existing code. Suggestions welcome!] 
    3030 
    31 The `fieldLabel` declaration desugars to: 
     31`fieldLabel` is __not__ some new ontology in Haskell, it's only sugar. The `fieldLabel` declaration desugars to: 
    3232{{{ 
    3333    data Proxy_customer_id                  -- phantom, a type 'peg'