[GHC] #9066: Template Haskell cannot splice an infix declaration for a data constructor

GHC ghc-devs at haskell.org
Sun Nov 2 20:10:12 UTC 2014


#9066: Template Haskell cannot splice an infix declaration for a data constructor
-------------------------------------+-------------------------------------
              Reporter:  goldfire    |            Owner:  goldfire
                  Type:  bug         |           Status:  new
              Priority:  normal      |        Milestone:
             Component:  Template    |          Version:  7.8.2
  Haskell                            |         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:              |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 Well, option (2) is infeasible. This is because desugaring a quoted fixity
 declaration produces `TH.Name`s that do ''not'' have namespace information
 attached. This is a consequence of the fact that namespace information is
 available only with `TH.Name`'s `NameG` constructor, which also has
 package and module information. Of course, when processing a quote, we
 have no idea what package/module the declaration will eventually end up
 in, so `NameG` is a non-starter. Thus, we have no namespace information
 here, and instead must be liberal when processing `Exact` `RdrName`s.

 I suppose the Right Way to fix this is to add namespace information to
 TH's `NameU` and `NameL` constructors, but that probably has farther-
 reaching implications than need to be dealt with at this moment.

 Going to implement (1).

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


More information about the ghc-tickets mailing list