Skip to content
  • Matthew Craven's avatar
    Equality of forall-types is visibility aware · cf86f3ec
    Matthew Craven authored and Vladislav Zavialov's avatar Vladislav Zavialov committed
    This patch finally (I hope) nails the question of whether
       (forall a. ty) and (forall a -> ty)
    are `eqType`: they aren't!
    
    There is a long discussion in #22762, plus useful Notes:
    
    * Note [ForAllTy and type equality] in GHC.Core.TyCo.Compare
    * Note [Comparing visiblities] in GHC.Core.TyCo.Compare
    * Note [ForAllCo] in GHC.Core.TyCo.Rep
    
    It also establishes a helpful new invariant for ForAllCo,
    and ForAllTy, when the bound variable is a CoVar:in that
    case the visibility must be coreTyLamForAllTyFlag.
    
    All this is well documented in revised Notes.
    cf86f3ec