Skip to content
Snippets Groups Projects
Forked from Glasgow Haskell Compiler / GHC
Source project has a limited visibility.
  • Simon Peyton Jones's avatar
    926ad6de
    Be more careful about quantification · 926ad6de
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    This MR is driven by #23051. It does several things:
    
    * It is guided by the generalisation plan described in #20686.
      But it is still far from a complete implementation of that plan.
    
    * Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind.
      This explains that we don't (yet, pending #20686) directly
      prevent generalising over escaping kinds.
    
    * In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep
      and Multiplicity variables, beause we don't want to quantify over
      them.  We want to do the same for a Concrete tyvar, but there is
      nothing sensible to default it to (unless it has kind RuntimeRep,
      in which case it'll be caught by an earlier case). So we promote
      instead.
    
    * Pure refactoring in GHC.Tc.Solver:
      * Rename decideMonoTyVars to decidePromotedTyVars, since that's
        what it does.
    
      * Move the actual promotion of the tyvars-to-promote from
        `defaultTyVarsAndSimplify` to `decidePromotedTyVars`.  This is a
        no-op; just tidies up the code.  E.g then we don't need to
        return the promoted tyvars from `decidePromotedTyVars`.
    
      * A little refactoring in `defaultTyVarsAndSimplify`, but no
        change in behaviour.
    
    * When making a TauTv unification variable into a ConcreteTv
      (in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name
      of the type variable.  This just improves error messages.
    
    * Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
    926ad6de
    History
    Be more careful about quantification
    Simon Peyton Jones authored and Marge Bot's avatar Marge Bot committed
    This MR is driven by #23051. It does several things:
    
    * It is guided by the generalisation plan described in #20686.
      But it is still far from a complete implementation of that plan.
    
    * Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind.
      This explains that we don't (yet, pending #20686) directly
      prevent generalising over escaping kinds.
    
    * In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep
      and Multiplicity variables, beause we don't want to quantify over
      them.  We want to do the same for a Concrete tyvar, but there is
      nothing sensible to default it to (unless it has kind RuntimeRep,
      in which case it'll be caught by an earlier case). So we promote
      instead.
    
    * Pure refactoring in GHC.Tc.Solver:
      * Rename decideMonoTyVars to decidePromotedTyVars, since that's
        what it does.
    
      * Move the actual promotion of the tyvars-to-promote from
        `defaultTyVarsAndSimplify` to `decidePromotedTyVars`.  This is a
        no-op; just tidies up the code.  E.g then we don't need to
        return the promoted tyvars from `decidePromotedTyVars`.
    
      * A little refactoring in `defaultTyVarsAndSimplify`, but no
        change in behaviour.
    
    * When making a TauTv unification variable into a ConcreteTv
      (in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name
      of the type variable.  This just improves error messages.
    
    * Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
Code owners
Assign users and groups as approvers for specific file changes. Learn more.