Provide macro __GLASGOW_HASKELL_TH__
The Debian packaging added a few hacks to create a CPP macro that can be used to distinguish compilers with Template Haskell support from those that don’t have that support. We need this to compiler some code on non-TH architectures.
It works, but we found that we cannot upstream such patches, which is a shame.
I propose that among the GHC-defined macros listed at https://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#c-pre-processor there is also __GLASGOW_HASKELL_TH__=YES
, which is available if the compiler supports splices, or __GLASGOW_HASKELL_TH__=NO
if not.
(I propose a two-valued comparison so that library authors can decide themselves what the default should be if this symbol is not defined, some might want to use TH on older compilers, some not.)
I hope this can be part of 7.10.