Changes between Version 7 and Version 8 of Records/DeclaredOverloadedRecordFields


Ignore:
Timestamp:
Feb 18, 2012 12:02:30 AM (2 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields

    v7 v8  
    88 * ''' [wiki:Records/DeclaredOverloadedRecordFields/ImplementorsView DORF -- Implementor's view] ''' 
    99 * ''' [wiki:Records/DeclaredOverloadedRecordFields/COmpareSORF DORF -- Comparison to SORF] ''' 
    10  * ''' [wiki:Records/DeclaredOverloadedRecordFields/DotPostfix Dot as Postfix Funcion Apply] '''   ('''''optional''''' syntactic sugar) 
     10 * ''' [wiki:Records/DeclaredOverloadedRecordFields/DotPostfix Dot as Postfix Function Apply] '''   ('''''optional''''' syntactic sugar) 
    1111 
    1212 
     
    2020 
    2121I'm avoiding giving implementation details here -- see: 
    22     <DORF -- Implementor's view>; and 
    23     <DORF -- comparison to SORF> 
     22    The Implementor's view and Comparison to SORF   (links above) 
    2423 
    2524I'm not saying anything about field selection via pattern matching or record construction using explicit data constructors -- those are to behave as currently (using the approach per ‑XDisambiguateRecordFields and friends). 
     
    4039}}} 
    4140is __not__ declaring `customer_id`, it's __using__ (or instancing) an already-declared field for `customer_id`. 
    42 Similarly, if I have a family of objects, all with a `rese`' method, that's not umpteen methods with a 'clash' of names, it's one method with umpteen instances. (And I might create a family of record structures to describe each object, and store the `reset` method within it.) 
     41Similarly, if I have a family of objects, all with a `reset` method, that's not umpteen methods with a 'clash' of names, it's one method with umpteen instances. (And I might create a family of record structures to describe each object, and store the `reset` method within it.) 
    4342 
    4443What's more, the Haskell 98 field selector (auto-created from the data decl) is half-way to what we want. It's a function: 
     
    147146    data T = MkT { x, y :: Int } 
    148147}}} 
    149 then you are exporting the `x` field within record type `T`, but _not_ the field selector `x` (nor the generated type 'peg' `Proxy_x`). 
     148then you are exporting the `x` field within record type `T`, but __not__ the field selector `x` (nor the generated type 'peg' `Proxy_x`). 
    150149 
    151150Type `T` and field label `x` are exported, but not data constructor `MkT`, so `x` is unusable. 
     
    196195 
    197196 
    198  
    199  
     197POsted 18-Feb-2012, Anthony Clayden. [Apologies for my wiki formatting and cross-linking -- in haste! and a novice to trac.] 
     198 
     199 
     200 
     201