• Simon Peyton Jones's avatar
    Get rid of TcTyVars more assiduously · 99689492
    Simon Peyton Jones authored
    * I found a bug in 'generalize' in TcTyClsDecls.kcTyClGroup, where
      the kind variables weren't being turned into proper TyVars, so
      we got (skolem) TcTyVars in TyCons, which shouldn't happen.  Fix
      was easy.
    
    * Similarly TcHsType.kindGeneralizeType wasn't turning the forall'd
      TcTyVars into TyVars.  To achieve this I defined TcHsTyn.zonkSigType.
    
    * All this allowed me to remove awkward and ill-explained bit of
      footwork on DFunIds in Inst.newClsInst
    
    This is just refactoring, but it does make the printout from
    -ddump-deriv make a bit more sense by not grautuitiously cloning
    type variables.  In the display I was seeing
    
       instance C [a_df4] where
          f x = ...a_dx5...
    
    where actually the d_df4 and a_dx5 were the same.
    99689492
TcTyClsDecls.hs 120 KB