• Simon Peyton Jones's avatar
    (Another) minor refactoring of substitutions · b5292557
    Simon Peyton Jones authored
    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)
    b5292557
TcTyClsDecls.hs 111 KB