Skip to content
  • Ryan Scott's avatar
    Name (tc)SplitForAll- functions more consistently · d61adb3d
    Ryan Scott authored and Marge Bot's avatar Marge Bot committed
    There is a zoo of `splitForAll-` functions in `GHC.Core.Type` (as well as
    `tcSplitForAll-` functions in `GHC.Tc.Utils.TcType`) that all do very similar
    things, but vary in the particular form of type variable that they return. To
    make things worse, the names of these functions are often quite misleading.
    Some particularly egregious examples:
    
    * `splitForAllTys` returns `TyCoVar`s, but `splitSomeForAllTys` returns
      `VarBndr`s.
    * `splitSomeForAllTys` returns `VarBndr`s, but `tcSplitSomeForAllTys` returns
      `TyVar`s.
    * `splitForAllTys` returns `TyCoVar`s, but `splitForAllTysInvis` returns
      `InvisTVBinder`s. (This in particular arose in the context of #18939, and
      this finally motivated me to bite the bullet and improve the status quo
      vis-à-vis how we name these functions.)
    
    In an attempt to bring some sanity to how these functions are named, I have
    opted to rename most of these functions en masse to use consistent suffixes
    that describe the particular f...
    d61adb3d