Skip to content
  • Ben Gamari's avatar
    Increase type sharing · 083a7583
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Fixes #20541 by making mkTyConApp do more sharing of types.
    In particular, replace
    
    * BoxedRep Lifted    ==>  LiftedRep
    * BoxedRep Unlifted  ==>  UnliftedRep
    * TupleRep '[]       ==>  ZeroBitRep
    * TYPE ZeroBitRep    ==>  ZeroBitType
    
    In each case, the thing on the right is a type synonym
    for the thing on the left, declared in ghc-prim:GHC.Types.
    See Note [Using synonyms to compress types] in GHC.Core.Type.
    
    The synonyms for ZeroBitRep and ZeroBitType are new, but absolutely
    in the same spirit as the other ones.   (These synonyms are mainly
    for internal use, though the programmer can use them too.)
    
    I also renamed GHC.Core.Ty.Rep.isVoidTy to isZeroBitTy, to be
    compatible with the "zero-bit" nomenclature above.  See discussion
    on !6806.
    
    There is a tricky wrinkle: see GHC.Core.Types
      Note [Care using synonyms to compress types]
    
    Compiler allocation decreases by up to 0.8%.
    083a7583