X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FVarEnv.lhs;h=d219fe5508cc0de385eac3c6a4312c8fb6f9d5ef;hb=b2a9c48ee5593cda05748c2cd261897392c7152d;hp=646d5fa1d713ece9ea8fedb2b73e2b5cf6c66bca;hpb=d2cca44eae15bbbd3b86889448e796bc785dfa52;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/VarEnv.lhs b/ghc/compiler/basicTypes/VarEnv.lhs index 646d5fa..d219fe5 100644 --- a/ghc/compiler/basicTypes/VarEnv.lhs +++ b/ghc/compiler/basicTypes/VarEnv.lhs @@ -21,7 +21,7 @@ module VarEnv ( -- SubstEnvs SubstEnv, TyVarSubstEnv, SubstResult(..), - emptySubstEnv, substEnvEnv, + emptySubstEnv, substEnvEnv, elemSubstEnv, mkSubstEnv, lookupSubstEnv, extendSubstEnv, extendSubstEnvList, delSubstEnv, delSubstEnvList, noTypeSubst, isEmptySubstEnv ) where @@ -50,6 +50,8 @@ When tidying up print names, we keep a mapping of in-scope occ-names \begin{code} type TidyEnv = (TidyOccEnv, VarEnv Var) + +emptyTidyEnv :: TidyEnv emptyTidyEnv = (emptyTidyOccEnv, emptyVarEnv) \end{code} @@ -93,6 +95,9 @@ isEmptySubstEnv (SE s _) = isEmptyVarEnv s lookupSubstEnv :: SubstEnv -> Var -> Maybe SubstResult lookupSubstEnv (SE s _) v = lookupVarEnv s v +elemSubstEnv :: Var -> SubstEnv -> Bool +elemSubstEnv v (SE s _) = elemVarEnv v s + extendSubstEnv :: SubstEnv -> Var -> SubstResult -> SubstEnv extendSubstEnv (SE s nt) v r = SE (extendVarEnv s v r) (noTys r nt)