Confusing comments around SimplEnv
In GHC.Core.Opt.Simplify.Env
we see the following definition:
data SimplEnv
= SimplEnv {
----------- Static part of the environment -----------
-- Static in the sense of lexically scoped,
-- wrt the original expression
seMode :: !SimplMode
-- The current substitution
, seTvSubst :: TvSubstEnv -- InTyVar |--> OutType
, seCvSubst :: CvSubstEnv -- InCoVar |--> OutCoercion
, seIdSubst :: SimplIdSubst -- InId |--> OutExpr
----------- Dynamic part of the environment -----------
-- Dynamic in the sense of describing the setup where
-- the expression finally ends up
-- The current set of in-scope variables
-- They are all OutVars, and all bound in this module
, seInScope :: !InScopeSet -- OutVars only
, seCaseDepth :: !Int -- Depth of multi-branch case alternatives
}
- Surely
seCaseDepth
is also statically scoped, but it resides in the dynamic section. -
seIdSubst
also doesn't appear to be statically scoped, as it is used to inlinepreInlineUnconditionally
bindings.
Thoughts @simonpj ?