Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#8397 closed bug (fixed)

reify annotations in TH

Reported by: errge Owned by:
Priority: normal Milestone: 7.8.1
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking: #7867
Related Tickets: Differential Rev(s):
Wiki Page:


For the use-case detailed in #7867, this patch adds annotation reification to TH.

This may be useful as a simpler approach for other cases too, where the whole power GHC API is not needed.

Attachments (2)

ghc-8397.patch (5.3 KB) - added by errge 6 years ago.
ghc part
th-8397.patch (3.2 KB) - added by errge 6 years ago.
th part

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by errge

Attachment: ghc-8397.patch added

ghc part

Changed 6 years ago by errge

Attachment: th-8397.patch added

th part

comment:1 Changed 6 years ago by errge

Status: newpatch

comment:2 Changed 6 years ago by thoughtpolice

This patch looks good to me (#8398 needs more attention, as discussed in TemplateHaskell/Annotations) - on my queue.

comment:3 Changed 6 years ago by Austin Seipp <austin@…>

In 7186bdb1007cce27bf98ec9d96c9fe1d07099f0b/ghc:

Add machinery to reify annotations (#8397)

Authored-by: Gergely Risko <>
Signed-off-by: Austin Seipp <>

comment:4 Changed 6 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged, thanks!

comment:5 Changed 6 years ago by errge

Thanks for merging this. As a small addition I posted #8460.

Also, I made huge efforts on last weekend to get rid of the controversies around #8398 and posted #8426 with an IMHO very well separated and safe patch. Can someone at least please take a look?

comment:6 Changed 6 years ago by simonpj

Errge, thank you for the work you are doing on TH. I'm one of the most obvious people to take a look, but I am deep under water, with too little time to offer. I would be happy if others were willing to review Errge's work.

Meanwhile, I have over a dozen messages/tickets in my inbox mentioning you, so one disabling factor is that I'm simply getting lost. You are clearly on a crusade to improve TH, which is great, and each of these messages/tickets is one battle in that crusade, but I lack an overall picture.

  • I don't know which are crucial and which are nice-to-have.
  • I don't know which if any you are trying to squeeze into 7.8.1 and if so why they are crucial. (I hope there are not many of those, ideally none, because it is so late.)
  • I don't know which are bug-fixes and which are new features.
  • I don't know which change the API for TH. Changing API is, these days, quite a big deal because it affects many TH users, so we need to be thoughtful about it.

In short, I'm a bit overwhelmed.

I wonder if it would help to start a wiki page with your plan, pointing to the various tickets, and how they contribute to it, and giving some kind of priority order. That way I can focus cycles on the bits you consider most important

comment:7 Changed 6 years ago by errge

Thank you Simon for your criticism.

Sorry for the spam in the recent weeks. To be fair, at least half of it is not related at all to TH. Simply: now I "opened" GHC and constantly find little stuff here and there that I'm happy to work on. The only relationship that some of my bugs have to TH is that before implementing the TH features I was always too afraid to try to patch GHC.

Nevertheless, I've did the following to improve my communication right now:

  • I cleaned up my bugs:
    • properly tagged all of them for target release (most of them for 7.10.1),
    • properly set up component, so you can filter for TH,
  • I created the wikipage 1.5 weeks ago to provide exactly the info that you are asking for, I'll now go and actualize it and more clearly mark the urgent and nice-to-haves.

To get an overview about all of my bugs, you can use this query:

The only one that I need to be merged for my use-case to work at all with 7.8.1 is #1480. In that one, I only add to the TH API, so it won't break anyone and I implement a feature that is meaningful to have anyways. If you only have time to review one more, please review that one. That is the only urgent one.

And thanks for not giving up on this one in spite of the amount of requests that come from me.

comment:8 Changed 6 years ago by simonpj

It would be better to conduct this conversation on ghc-devs but I don't know your email address, and I don't know if you are on ghc-devs, so I'll continue here. Maybe you can reply on ghc-devs.

Thanks for the wiki page. I've had a look. What's missing is the actual design proposal itself! I have made some minor edits, leaving a blank section for you to fill in. Think of it from the point of view of a programmer... what do they need to know? Perhaps show how the new API lets you implement the stuff you want.

As to details of #1480, I'm really not sure that we need both qReifyImports and qReifyModule. Can't we just use qReifyModule to get the imports of the current module?

Last edited 6 years ago by simonpj (previous) (diff)
Note: See TracTickets for help on using tickets.