(Another) minor refactoring of substitutions
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 18 Feb 2016 11:25:38 +0000 (11:25 +0000)
committerBen Gamari <ben@smart-cactus.org>
Sun, 13 Mar 2016 19:38:45 +0000 (20:38 +0100)
commit5da67bae23313cd5632c903c8369e03865628b34
treec3b29ded1aa1c073c93a185eb857d0242f9d672b
parent3162121b0c23f8535ab55903cdcaa93361a9d403
(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)

(cherry picked from commit b5292557dcf2e3844b4837172230575d40a8917e)
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