(Another) minor refactoring of substitutions
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 18 Feb 2016 11:25:38 +0000 (11:25 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 18 Feb 2016 11:35:06 +0000 (11:35 +0000)
commitb5292557dcf2e3844b4837172230575d40a8917e
tree82533d296b35b1553898a1380a43a0ba91efb77a
parent01449eb552daa082e46ceaaf8481708ee73dc2ad
(Another) minor refactoring of substitutions

No change in functionality here, but greater clarity:

* In FamInstEnv.FlattenEnv, kill off the fi_in_scope field
  We are already maintaining an in-scope set in the fe_subst field,
  so it's silly do to it twice.

  (This isn't strictly connected to the rest of this patch, but
  the nomenclature changes below affect the same code, so I put
  them together.)

* TyCoRep.extendTCVSubst used to take a TyVar or a CoVar and work
  out what to do, but in fact we almost always know which of the
  two we are doing.  So:
    - define extendTvSubst, extendCvSubst
    - and use them

* Similar renamings in TyCoRep:
   - extendTCvSubstList        -->   extendTvSubstList
   - extendTCvSubstBinder      -->   extendTvSubstBinder
   - extendTCvSubstAndInScope  --> extendTvSubstAndInScope

* Add Type.extendTvSubstWithClone, extendCvSubstWithClone

* Similar nomenclature changes in Subst, SimplEnv, Specialise

* Kill off TyCoRep.substTelescope (never used)
22 files changed:
compiler/basicTypes/MkId.hs
compiler/coreSyn/CoreLint.hs
compiler/coreSyn/CoreSubst.hs
compiler/coreSyn/CoreUtils.hs
compiler/iface/IfaceType.hs
compiler/main/GhcPlugins.hs
compiler/simplCore/SimplEnv.hs
compiler/simplCore/Simplify.hs
compiler/specialise/Specialise.hs
compiler/typecheck/Inst.hs
compiler/typecheck/TcClassDcl.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcHsType.hs
compiler/typecheck/TcMType.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcType.hs
compiler/types/Coercion.hs
compiler/types/FamInstEnv.hs
compiler/types/OptCoercion.hs
compiler/types/TyCoRep.hs
compiler/types/Type.hs