Reorganisation of exports in template-haskell library
When working on documentation for the template-haskell library (see #4429 (closed)), I noticed a few inconveniences with the library. Here are some changes I would suggest:
- I think
runQ
should not be exported fromLanguage.Haskell.TH
-- rather, it should only be exported fromLanguage.Haskell.TH.Syntax.Internals
. It should only be used by GHC internals or debugging, and not for ordinary use of template haskell - I think the "Internal functions" in
Language.Haskell.TH.Syntax
should be moved toLanguage.Haskell.TH.Syntax.Internals
. - it is quite annoying that
Language.Haskell.TH
manually reexports almost all functions fromLanguage.Haskell.TH.Syntax
and indeed all functions fromLanguage.Haskell.TH.Lib
. I would like to turn these name-by-name exports into module exports like so:
module Language.Haskell.TH(
module Language.Haskell.TH.Syntax,
module Language.Haskell.TH.Lib,
-- * Pretty-printing
...
)
There are a few reasons I would like to do this last change:
- it is a constant effort to keep the export list of
Language.Haskell.TH
synchronised with those ofLanguage.Haskell.TH.Syntax
andLanguage.Haskell.TH.Lib
- I've added a number of notes (like the
$unresolvedinfix
note I added earlier) toLanguage.Haskell.TH.Syntax
, and it is not possible to also export these fromLanguage.Haskell.TH
without copy-pasting the notes. This means that the documentation ofLanguage.Haskell.TH.Syntax
is better than the documentation forLanguage.Haskell.TH
, so users will eventually have to look there. Why not just link them there directly?
I'm not sure what the correct place is for a discussion like this of library design, so I posted here.
Trac metadata
Trac field | Value |
---|---|
Version | 7.2.1 |
Type | Task |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Template Haskell |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |