Changes between Version 1 and Version 2 of ImplementingTreesThatGrow/HsSyn


Ignore:
Timestamp:
Aug 17, 2018 11:16:07 PM (16 months ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ImplementingTreesThatGrow/HsSyn

    v1 v2  
    3434* The type parameter `x` is the ''index'' of the data type; different clients (GHC, TH, haskell-src-exts) will instantiate it differently.
    3535
    36 * The first field of each base constructor is the ''extension field'', of type `XApp x` for the `HsApp` constructor.
    37 
    38 * The type family `XApp x` specifies the type of the extension field for `HsApp` for the index `x`.
     36* The first field of each base constructor is the ''extension field'', e.g. of type `XApp x` for the `HsApp` constructor.  The type family `XApp x` specifies the type of the extension field for `HsApp` for the index `x`.
    3937
    4038* The `NewExpr` constructor is called the ''extension constructor'' of the type, and always comes last.  Clients can use this to extend the data type with new data constructors by giving a suitable type instance for `XNewExpr`.
     
    8179* The type family `GhcId` can be a closed family, since `GhcPhase` is a data type with just three constructors.
    8280
    83 * Note 3: GHC uses the extension constructor `NewExpr` to allow a location to be added at any point in the syntax tree.  (Unlike the old ping/pong style, a location is not required at every node.)  This is a significant change.  Other alternatives are discussed below ''ToDo: add an explicit pointer''
     81* Note 3: GHC uses the extension constructor `NewExpr` to allow a location to be added at any point in the syntax tree.  (Unlike the old ping/pong style, a location is not required at every node.)  This is a significant change.  Other alternatives are discussed in [wiki:ImplementingTreesThatGrow/HandlingSourceLocations].
     82
     83== To Do ==
     84
     85* Add description of `HasSrcSpan`.