Skip to content

expose minf_rdr_env

Motivation

The GlobalRdrEnv of a module is very useful for tooling authors, see https://gitlab.com/tseenshe/hsinspect/blob/503cd48faba5b308be29ed44a12f7d6b22105f2b/exe/Main.hs#L53-61 for a working example.

However, minf_rdr_env is not exposed (an oversight?) so users of the api must invoke a full typecheck phase on the full file (or manually parse just the import section).

Proposal

Adding and exporting the following from GHC.hs

   modInfoRdrEnv :: ModuleInfo -> Maybe GlobalRdrEnv
   modInfoRdrEnv = minf_rdr_env

Would it make sense to backport this for any upcoming 8.6 releases?

Edited by Sam Halliday
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information