Hi Greg,
Perhaps a less-invasive way to implement the -XSafe part of your
proposal would be to provide a module like:
module Language.Haskell.TH.Safe (
module Language.Haskell.TH,
reifyWithoutNameG,
) where
import Language.Haskell.TH hiding (runIO, reify*)
where reifyWithoutNameG is the same as reify, except definitions that
are out of scope are either missing or modified such that they use
NameQ instead of NameG for out-of-scope names.
That way there is no new syntax needed, and safe TH can be called by
unsafe TH without any conversions.
I think defining another monad like Q that can do less is too
inconvenient because you have to disambiguate between Safe.listE and
Unsafe.listE, or make those functions more polymorphic (which makes
type errors worse). Another option would be if there were