Local modules and Template Haskell declaration splices
Sometimes you want a Template Haskell splice to expand to a bunch of declarations, some of which are not visible to the context. A trivial example might be
module M where $(f 4) ====> expands to module M where helper = ...blah... real_fun = ...helper....
helper is only a helper function for
real_fun and should not be exported by M, nor should it conflict with other definitions in M.
See #5398 (closed) for a more concrete example, and (at the end) a speculative suggestion for "local modules" that might be a good design.
Another thing you might want is for a splice to expand into some import declarations that bring some new stuff into scope. That too might be possible using this design.
Prioity uncertain, details very uncertain. I'm just making the ticket to keep track of the idea.