X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FsimplCore%2FSimplEnv.lhs;h=896fe976268f7e5133a7fc20e9887632bf0fbba9;hp=9f424cd09f80aa95ab68d011e4dfc08641329992;hb=491b818a4a9bd2160107178499e160d62933f58c;hpb=30c17e7096919c55218083c8fcb98e6287552058 diff --git a/compiler/simplCore/SimplEnv.lhs b/compiler/simplCore/SimplEnv.lhs index 9f424cd..896fe97 100644 --- a/compiler/simplCore/SimplEnv.lhs +++ b/compiler/simplCore/SimplEnv.lhs @@ -46,6 +46,8 @@ import VarEnv import VarSet import OrdList import Id +import MkCore +import TysWiredIn import qualified CoreSubst import qualified Type ( substTy, substTyVarBndr, substTyVar ) import Type hiding ( substTy, substTyVarBndr, substTyVar ) @@ -220,13 +222,31 @@ seIdSubst: \begin{code} mkSimplEnv :: SimplifierMode -> SimplEnv mkSimplEnv mode - = SimplEnv { seCC = subsumedCCS, - seMode = mode, seInScope = emptyInScopeSet, - seFloats = emptyFloats, - seTvSubst = emptyVarEnv, seIdSubst = emptyVarEnv } + = SimplEnv { seCC = subsumedCCS + , seMode = mode + , seInScope = init_in_scope + , seFloats = emptyFloats + , seTvSubst = emptyVarEnv + , seIdSubst = emptyVarEnv } -- The top level "enclosing CC" is "SUBSUMED". ---------------------- +init_in_scope :: InScopeSet +init_in_scope = mkInScopeSet (unitVarSet (mkWildValBinder unitTy)) + -- See Note [WildCard binders] +\end{code} + +Note [WildCard binders] +~~~~~~~~~~~~~~~~~~~~~~~ +The program to be simplified may have wild binders + case e of wild { p -> ... } +We want to *rename* them away, so that there are no +occurrences of 'wild' (with wildCardKey). The easy +way to do that is to start of with a representative +Id in the in-scope set + +There should be no *occurrences* of wild. + +\begin{code} getMode :: SimplEnv -> SimplifierMode getMode env = seMode env