Changes between Version 9 and Version 10 of Records/DeclaredOverloadedRecordFields/ImplementorsView


Ignore:
Timestamp:
Feb 21, 2012 2:44:49 AM (3 years ago)
Author:
guest
Comment:

pretty up links -- AntC

Legend:

Unmodified
Added
Removed
Modified
  • Records/DeclaredOverloadedRecordFields/ImplementorsView

    v9 v10  
    1010The fact that DORF has been 'faked' in existing GHC is good evidence that it's a modest change. Furthermore, we can implement H98-style records/fields using the same mechanism.
    1111
    12 DORF is to be enabled by a compiler flag '''‑XDeclaredOverloadedRecordFields''', which implies flag '''‑XNoMonoRecordFields''', which in turn implies ‑XDisambiguateRecordFields and -XNamedFieldPuns with ‑XRecordWildCards.
    13 
    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.
     12DORF is to be enabled by a compiler flag '''‑XDeclaredOverloadedRecordFields''', which implies flag '''[wiki:Records/DeclaredOverloadedRecordFields/NoMonoRecordFields ‑XNoMonoRecordFields]''', which in turn implies ‑XDisambiguateRecordFields and -XNamedFieldPuns with ‑XRecordWildCards.
     13
     14Note we do __not__ assume flag '''[wiki:Records/DeclaredOverloadedRecordFields/DotPostfix ‑XDotPostfixFuncApply]'''; dot notation is not needed by DORF, it's purely syntactic sugar to suit the taste of the programmer.
    1515
    1616DORF 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.
     
    209209=== Representation hiding/import/export ===
    210210
    211 See the discussion under <Application Programmer's view> and http://hackage.haskell.org/trac/ghc/wiki/Records/DeclaredOverloadedRecordFields/NoMonoRecordFields. When import/exporting do we need to also export the Proxy_type? If not exported, update syntax cannot be desuggarred to use it.)
     211See the discussion under [wiki:Records/DeclaredOverloadedRecordFields#ApplicationProgrammersview Application Programmer's view] and [wiki:Records/DeclaredOverloadedRecordFields/NoMonoRecordFields No Mono Record Fields]. When import/exporting do we need to also export the Proxy_type? If not exported, update syntax cannot be desuggarred to use it.)
    212212
    213213=== Should application programmers declare instances for `Has/set`? ===
     
    215215Nothing so far suggests they should. (And there's obvious dangers in allowing it.)
    216216
    217 But updating through virtual fields might need it. See <DORF -- comparison to SORF>#<Virtual record selectors>.
    218 
     217But updating through virtual fields might need it. See [wiki:Records/DeclaredOverloadedRecordFields/COmpareSORF#Virtualrecordselectors Virtual Record selectors].
     218