[GHC] #9628: Add Annotations to the AST to simplify source to source conversions

GHC ghc-devs at haskell.org
Fri Oct 10 18:03:49 UTC 2014


#9628: Add Annotations to the AST to simplify source to source conversions
-------------------------------------+-------------------------------------
              Reporter:  alanz       |            Owner:  alanz
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.9
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:  D297        |
-------------------------------------+-------------------------------------

Comment (by alanz):

 I share Neil's concern about the fragility of the string lookup.

 A user of this feature would have to keep track of the string key, as well
 as the shape of the returned structure used for the particular annotation,
 and would not know until runtime failure that there was a problem.

 I think the hybrid approach where there is a specific enumerated type for
 the keyword/feature being looked up could be workable, but requires the
 API user to consult the parser.y.pp file to see exactly what fits in
 where.

 From a user of the feature point of view, having a straightforward mapping
 from the constructor name to the annotation name which can then be
 interrogated via e.g. ghci is definitely beneficial.

 This does require an explosion of types, but this is pretty much a once-
 off exercise.  Is there a code size problem if many classes are derived
 for each one?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9628#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list