Changes between Version 17 and Version 18 of Records/DeclaredOverloadedRecordFields


Ignore:
Timestamp:
Mar 3, 2012 5:14:10 AM (3 years ago)
Author:
AntC
Comment:

add possible approach to avoid fieldLabel decls everywhere

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields

    v17 v18  
    6767    (See discussion at [wiki:Records/DeclaredOverloadedRecordFields/COmpareSORF#TheStringtypeparametertoHasandScopecontrol Wild afterthought].)
    6868
    69 The `-> Int` means the field's domain (type) is `Int` -- it's just a type.
     69'''Option Three: Mixed In-situ and Declared ORF:'''
     70
     71    [Added 3-March in response to concerns at the extra effort for a `fieldLabel` for all fields, not just the shared ones.]
     72
     73Support 'flagging' in the record declaration whether field names are intended to be shared. Possible syntax:
     74{{{
     75    data Cust_AdHoc = CustAH{ customer_id :: Int, x, y :: String } sharing (customer_id) deriving (...)
     76}}}
     77 * Fields listed as sharing must have the `fieldLabel` (per Option One or Two).
     78 * Fields not sharing will get a fieldLabel declared for them,[[BR]] and it will be monomorphic (bound to a single record type).
     79
     80    [End of 3-March addition.]
     81
     82The field selectors result type `-> Int` means the field's domain (type) is `Int` -- it's just a type.
    7083We might also want to constrain the record -- for example to be sure it is savable to persistent storage:
    7184{{{