[GHC] #10823: Expose keepAlive to Template Haskell

GHC ghc-devs at haskell.org
Wed Sep 2 21:57:43 UTC 2015


#10823: Expose keepAlive to Template Haskell
-------------------------------------+-------------------------------------
        Reporter:  spinda            |                   Owner:
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:  7.12.1
       Component:  Template Haskell  |                 Version:  7.10.2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by spinda):

 Is the use of type-level literals essential here? That requires the user
 to have {{{DataKinds}}} enabled. Otherwise, the hack can fill our use
 case, I think.

 On the other hand, I worry about Template Haskell code having to depend
 too much on tricks that happen to work but aren't a guaranteed, stable,
 documented part of the interface. See, for example, the issue with
 quasiquoter behavior that appeared in #10047: suddenly, the "trick" that
 quasiquoters didn't split declaration groups went away, because it wasn't
 part of the actual spec. By contrast, functionality exposed through an
 explicit piece of the Template Haskell API will not suddenly disappear as
 a consequence of a tangential patch.

 //That said//, as I write this, I've realized that there may be another
 way to approach our particular issue. {{{[lq| inline gt |]}}} attaches an
 annotation to {{{gt}}}, so perhaps the solution should be to tell the
 desugarer not to consider any function with an annotation attached as dead
 code.

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


More information about the ghc-tickets mailing list