• Simon Peyton Jones's avatar
    Tidy up handling of coercion variables · cb08f8da
    Simon Peyton Jones authored
    * Comments to explain that a CoVar, whose IdInfo is CoVarId,
      is always unlifted (but may be nominal or representational role)
    
      And TyCoRep.isCoercionType picks out only those unlifted
      types, NOT the lifted versions
    
    * Introduce Var.NcId for non-co-var Ids
      with predicate isNonCoVarId
    
    * Add assertions in CoreSubst that the Id env is only
      used for NcIds
    
    * Fix lurking bug in CSE which extended the
      CoreSubst Id env with a CoVar
    
    * Fix two bugs in Specialise.spec_call, which wrongly treated
      CoVars like NcIds
        - needed a varToCoreExpr in one place
        - needed extendSubst not extendIdSubst in another
      This was the root cause of Trac #11644
    
    Minor refactoring
    
    * Eliminate unused mkDerivedLocalCoVarM, mkUserLocalCoVar
    * Small refactor in mkSysLocalOrCoVar
    cb08f8da
CSE.hs 12.2 KB