[Git][ghc/ghc][wip/sand-witch/tysyn-info-ppr] Update GHCi :info type synonym printing (24459)

Andrei Borzenkov (@sand-witch) gitlab at gitlab.haskell.org
Tue Mar 12 07:29:25 UTC 2024



Andrei Borzenkov pushed to branch wip/sand-witch/tysyn-info-ppr at Glasgow Haskell Compiler / GHC


Commits:
6227a9ce by Andrei Borzenkov at 2024-03-12T11:29:03+04:00
Update GHCi :info type synonym printing (24459)

- Do not print result's kind since we have full kind
  in SAKS and we display invisible arity using @-binders

- Do not suppress significant invisible binders

Invisible binder is considered significant when it meets at least
one of two following criteria:
  - It visibly occurs in the RHS type
  - It is not followed by a visible binder, so it
    affects arity of type synonym

- - - - -


23 changed files:

- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Type.hs
- testsuite/tests/backpack/cabal/bkpcabal08/bkpcabal08.stdout
- testsuite/tests/backpack/should_fail/T19244a.stderr
- testsuite/tests/backpack/should_fail/T19244b.stderr
- testsuite/tests/backpack/should_fail/bkpfail46.stderr
- testsuite/tests/ghci/T18060/T18060.stdout
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T15941.stdout
- testsuite/tests/ghci/scripts/T19310.stdout
- testsuite/tests/ghci/scripts/T21294a.stdout
- + testsuite/tests/ghci/scripts/T24459.script
- + testsuite/tests/ghci/scripts/T24459.stdout
- testsuite/tests/ghci/scripts/T8535.stdout
- testsuite/tests/ghci/scripts/T9181.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/ghci/scripts/ghci020.stdout
- testsuite/tests/ghci/should_run/T10145.stdout
- testsuite/tests/ghci/should_run/T18594.stdout
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/rep-poly/RepPolyBackpack3.stderr


Changes:

=====================================
compiler/GHC/Core/TyCon.hs
=====================================
@@ -25,7 +25,7 @@ module GHC.Core.TyCon(
         mkRequiredTyConBinder,
         mkAnonTyConBinder, mkAnonTyConBinders,
         tyConBinderForAllTyFlag, tyConBndrVisForAllTyFlag, isNamedTyConBinder,
-        isVisibleTyConBinder, isInvisibleTyConBinder,
+        isVisibleTyConBinder, isInvisSpecTyConBinder, isInvisibleTyConBinder,
         isVisibleTcbVis, isInvisSpecTcbVis,
 
         -- ** Field labels
@@ -514,6 +514,10 @@ isInvisSpecTcbVis :: TyConBndrVis -> Bool
 isInvisSpecTcbVis (NamedTCB Specified) = True
 isInvisSpecTcbVis _                    = False
 
+isInvisSpecTyConBinder :: VarBndr tv TyConBndrVis -> Bool
+-- Works for IfaceTyConBinder too
+isInvisSpecTyConBinder (Bndr _ tcb_vis) = isInvisSpecTcbVis tcb_vis
+
 isInvisibleTyConBinder :: VarBndr tv TyConBndrVis -> Bool
 -- Works for IfaceTyConBinder too
 isInvisibleTyConBinder tcb = not (isVisibleTyConBinder tcb)


=====================================
compiler/GHC/Iface/Syntax.hs
=====================================
@@ -1033,15 +1033,14 @@ pprIfaceDecl ss (IfaceClass { ifName  = clas
 
 pprIfaceDecl ss (IfaceSynonym { ifName    = tc
                               , ifBinders = binders
-                              , ifSynRhs  = mono_ty
+                              , ifSynRhs  = poly_ty
                               , ifResKind = res_kind})
   = vcat [ pprStandaloneKindSig name_doc (mkIfaceTyConKind binders res_kind)
-         , hang (text "type" <+> pprIfaceDeclHead suppress_bndr_sig [] ss tc binders <+> equals)
-           2 (sep [ pprIfaceForAll tvs, pprIfaceContextArr theta, ppr_tau
-                  , ppUnless (isIfaceLiftedTypeKind res_kind) (dcolon <+> ppr res_kind) ])
+         , hang (text "type" <+> pprIfaceDeclHeadInvis suppress_bndr_sig [] ss tc binders tau <+> equals)
+           2 (sep [ pprIfaceForAll tvs, pprIfaceContextArr theta, ppr_tau ])
          ]
   where
-    (tvs, theta, tau) = splitIfaceSigmaTy mono_ty
+    (tvs, theta, tau) = splitIfaceSigmaTy poly_ty
     name_doc = pprPrefixIfDeclBndr (ss_how_much ss) (occName tc)
 
     -- See Note [Printing type abbreviations] in GHC.Iface.Type
@@ -1232,6 +1231,18 @@ pprIfaceDeclHead suppress_sig context ss tc_occ bndrs
           <+> pprIfaceTyConBinders suppress_sig
                 (suppressIfaceInvisibles (PrintExplicitKinds print_kinds) bndrs bndrs) ]
 
+pprIfaceDeclHeadInvis :: SuppressBndrSig
+                 -> IfaceContext -> ShowSub -> Name
+                 -> [IfaceTyConBinder]   -- of the tycon, for invisible-suppression
+                 -> IfaceType -- RHS
+                 -> SDoc
+pprIfaceDeclHeadInvis suppress_sig context ss tc_occ bndrs rhs
+  = sdocOption sdocPrintExplicitKinds $ \print_kinds ->
+    sep [ pprIfaceContextArr context
+        , pprPrefixIfDeclBndr (ss_how_much ss) (occName tc_occ)
+          <+> pprIfaceTyConBinders suppress_sig
+                (suppressIfaceInsignificantInvisibles (PrintExplicitKinds print_kinds) rhs bndrs) ]
+
 pprIfaceConDecl :: ShowSub -> Bool
                 -> IfaceTopBndr
                 -> [IfaceTyConBinder]


=====================================
compiler/GHC/Iface/Type.hs
=====================================
@@ -54,7 +54,7 @@ module GHC.Iface.Type (
         pprIfaceCoTcApp, pprTyTcApp, pprIfacePrefixApp,
         isIfaceRhoType,
 
-        suppressIfaceInvisibles,
+        suppressIfaceInvisibles, suppressIfaceInsignificantInvisibles,
         stripIfaceInvisVars,
         stripInvisArgs,
 
@@ -521,6 +521,26 @@ suppressIfaceInvisibles (PrintExplicitKinds False) tys xs = suppress tys xs
         | isInvisibleTyConBinder k =     suppress ks xs
         | otherwise                = x : suppress ks xs
 
+-- Invisible binder is considered significant when it meet at least
+-- one of two following criteria:
+--   - It visibly occurs in the RHS type
+--   - It is not followed by a visible binder, so it
+--     affects arity of type synonym
+suppressIfaceInsignificantInvisibles :: PrintExplicitKinds -> IfaceType -> [IfaceTyConBinder] -> [IfaceTyConBinder]
+suppressIfaceInsignificantInvisibles (PrintExplicitKinds True) _rhs tys = tys
+suppressIfaceInsignificantInvisibles (PrintExplicitKinds False) rhs tys = suppress [] tys
+    where
+      mentioned_var var = ifTyConBinderName var `ifTypeVarVisiblyOccurs` rhs
+
+      mentioned_vars vars =
+        filter mentioned_var vars
+
+      suppress acc []     = reverse acc
+      suppress acc (k:ks) = case binderFlag k of
+          NamedTCB Specified -> suppress (k : acc) ks
+          NamedTCB Inferred  -> suppress acc ks
+          _                  -> reverse (mentioned_vars acc) ++ k : suppress [] ks
+
 stripIfaceInvisVars :: PrintExplicitKinds -> [IfaceTyConBinder] -> [IfaceTyConBinder]
 stripIfaceInvisVars (PrintExplicitKinds True)  tyvars = tyvars
 stripIfaceInvisVars (PrintExplicitKinds False) tyvars
@@ -561,6 +581,27 @@ ifTypeIsVarFree ty = go ty
     go_args IA_Nil = True
     go_args (IA_Arg arg _ args) = go arg && go_args args
 
+ifTypeVarVisiblyOccurs :: IfLclName -> IfaceType -> Bool
+-- Returns True if the type contains this name. Doesn't count
+-- invisible application
+-- Just used to control pretty printing
+ifTypeVarVisiblyOccurs name ty = go ty
+  where
+    go (IfaceTyVar var)         = var == name
+    go (IfaceFreeTyVar {})      = False
+    go (IfaceAppTy fun args)    = go fun || go_args args
+    go (IfaceFunTy _ w arg res) = go w || go arg || go res
+    go (IfaceForAllTy bndr ty)  = go (ifaceBndrType (binderVar bndr)) || go ty
+    go (IfaceTyConApp _ args)  = go_args args
+    go (IfaceTupleTy _ _ args) = go_args args
+    go (IfaceLitTy _)          = False
+    go (IfaceCastTy {})        = False -- Safe
+    go (IfaceCoercionTy {})    = False -- Safe
+
+    go_args IA_Nil = False
+    go_args (IA_Arg arg Required args) = go arg || go_args args
+    go_args (IA_Arg _arg _ args) = go_args args
+
 {- Note [Substitution on IfaceType]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Substitutions on IfaceType are done only during pretty-printing to


=====================================
testsuite/tests/backpack/cabal/bkpcabal08/bkpcabal08.stdout
=====================================
@@ -1,11 +1,11 @@
-Preprocessing library 'impl' for bkpcabal08-0.1.0.0...
-Building library 'impl' for bkpcabal08-0.1.0.0...
 Preprocessing library 'p' for bkpcabal08-0.1.0.0...
 Building library 'p' instantiated with
   A = <A>
   B = <B>
 for bkpcabal08-0.1.0.0...
 [2 of 2] Compiling B[sig]           ( p/B.hsig, nothing )
+Preprocessing library 'impl' for bkpcabal08-0.1.0.0...
+Building library 'impl' for bkpcabal08-0.1.0.0...
 Preprocessing library 'q' for bkpcabal08-0.1.0.0...
 Building library 'q' instantiated with
   A = <A>
@@ -13,13 +13,13 @@ Building library 'q' instantiated with
 for bkpcabal08-0.1.0.0...
 [2 of 4] Compiling B[sig]           ( q/B.hsig, nothing )
 [3 of 4] Compiling M                ( q/M.hs, nothing ) [A changed]
-[4 of 4] Instantiating bkpcabal08-0.1.0.0-5O1mUtZZLBeDZEqqtwJcCj-p
+[4 of 4] Instantiating bkpcabal08-0.1.0.0-CoQJNXLfoYQ4TyvApzFHv-p
 Preprocessing library 'q' for bkpcabal08-0.1.0.0...
 Building library 'q' instantiated with
-  A = bkpcabal08-0.1.0.0-DlVb5PcmUolGCHYbfTL7EP-impl:A
-  B = bkpcabal08-0.1.0.0-DlVb5PcmUolGCHYbfTL7EP-impl:B
+  A = bkpcabal08-0.1.0.0-5HJrxUERN7CD204UZeT4Ws-impl:A
+  B = bkpcabal08-0.1.0.0-5HJrxUERN7CD204UZeT4Ws-impl:B
 for bkpcabal08-0.1.0.0...
-[1 of 3] Compiling A[sig]           ( q/A.hsig, dist/build/bkpcabal08-0.1.0.0-LFiTKyjPqyn9yyuysCoVKg-q+5IA1jA4bEzCFcXtraqAC38/A.o ) [Prelude package changed]
-[2 of 3] Compiling B[sig]           ( q/B.hsig, dist/build/bkpcabal08-0.1.0.0-LFiTKyjPqyn9yyuysCoVKg-q+5IA1jA4bEzCFcXtraqAC38/B.o ) [Prelude package changed]
+[1 of 3] Compiling A[sig]           ( q/A.hsig, dist/build/bkpcabal08-0.1.0.0-1DQJ9DKc4h59P07qcb0kBc-q+J5mAfRWG9IgLmFQVftCb8t/A.o ) [Prelude package changed]
+[2 of 3] Compiling B[sig]           ( q/B.hsig, dist/build/bkpcabal08-0.1.0.0-1DQJ9DKc4h59P07qcb0kBc-q+J5mAfRWG9IgLmFQVftCb8t/B.o ) [Prelude package changed]
 Preprocessing library 'r' for bkpcabal08-0.1.0.0...
 Building library 'r' for bkpcabal08-0.1.0.0...


=====================================
testsuite/tests/backpack/should_fail/T19244a.stderr
=====================================
@@ -17,7 +17,7 @@ T19244a.bkp:22:9: error: [GHC-15843]
     • Type constructor ‘Key’ has conflicting definitions in the module
       and its hsig file.
       Main module: type Key :: * -> Constraint
-                   type Key = GHC.Classes.Ord :: * -> Constraint
+                   type Key = GHC.Classes.Ord
         Hsig file: type Key :: forall {k}. k -> Constraint
                    class Key k1
       The types have different kinds.


=====================================
testsuite/tests/backpack/should_fail/T19244b.stderr
=====================================
@@ -1,20 +1,20 @@
 [1 of 3] Processing user
-  [1 of 2] Compiling Map[sig]         ( user\Map.hsig, nothing )
-  [2 of 2] Compiling User             ( user\User.hs, nothing )
+  [1 of 2] Compiling Map[sig]         ( user/Map.hsig, nothing )
+  [2 of 2] Compiling User             ( user/User.hs, nothing )
 [2 of 3] Processing ordmap
   Instantiating ordmap
-  [1 of 1] Compiling Map              ( ordmap\Map.hs, T19244b.out\ordmap\Map.o )
+  [1 of 1] Compiling Map              ( ordmap/Map.hs, T19244b.out/ordmap/Map.o )
 [3 of 3] Processing main
   Instantiating main
   [1 of 1] Including user[Map=ordmap:Map]
     Instantiating user[Map=ordmap:Map]
-    [1 of 2] Compiling Map[sig]         ( user\Map.hsig, T19244b.out\user\user-GzloW2NeDdA2M0V8qzN4g2\Map.o )
+    [1 of 2] Compiling Map[sig]         ( user/Map.hsig, T19244b.out/user/user-GzloW2NeDdA2M0V8qzN4g2/Map.o )
 
 T19244b.bkp:11:27: error: [GHC-15843]
     • Type constructor ‘Key’ has conflicting definitions in the module
       and its hsig file.
       Main module: type Key :: * -> Constraint
-                   type Key = GHC.Classes.Ord :: * -> Constraint
+                   type Key = GHC.Classes.Ord
         Hsig file: type Key :: forall {k}. k -> Constraint
                    class Key k1
       The types have different kinds.


=====================================
testsuite/tests/backpack/should_fail/bkpfail46.stderr
=====================================
@@ -1,20 +1,20 @@
 [1 of 3] Processing p
-  [1 of 2] Compiling A[sig]           ( p\A.hsig, nothing )
-  [2 of 2] Compiling M                ( p\M.hs, nothing )
+  [1 of 2] Compiling A[sig]           ( p/A.hsig, nothing )
+  [2 of 2] Compiling M                ( p/M.hs, nothing )
 [2 of 3] Processing q
   Instantiating q
-  [1 of 1] Compiling A                ( q\A.hs, bkpfail46.out\q\A.o )
+  [1 of 1] Compiling A                ( q/A.hs, bkpfail46.out/q/A.o )
 [3 of 3] Processing r
   Instantiating r
   [1 of 1] Including p[A=q:A]
     Instantiating p[A=q:A]
-    [1 of 2] Compiling A[sig]           ( p\A.hsig, bkpfail46.out\p\p-HVmFlcYSefiK5n1aDP1v7x\A.o )
+    [1 of 2] Compiling A[sig]           ( p/A.hsig, bkpfail46.out/p/p-HVmFlcYSefiK5n1aDP1v7x/A.o )
 
 bkpfail46.bkp:16:9: error: [GHC-15843]
     • Type constructor ‘K’ has conflicting definitions in the module
       and its hsig file.
       Main module: type K :: * -> Constraint
-                   type K a = GHC.Classes.Eq a :: Constraint
+                   type K a = GHC.Classes.Eq a
         Hsig file: type K :: * -> Constraint
                    class K a
       Illegal parameterized type synonym in implementation of abstract data.


=====================================
testsuite/tests/ghci/T18060/T18060.stdout
=====================================
@@ -1,5 +1,5 @@
 type (->) :: * -> * -> *
-type (->) = FUN Many :: * -> * -> *
+type (->) = FUN Many
   	-- Defined in ‘GHC.Types’
 infixr -1 ->
 instance Monoid b => Monoid (a -> b)


=====================================
testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
=====================================
@@ -74,13 +74,13 @@ data Tuple2# a b = (#,#) a b
 (#  ,  #) :: a -> b -> Tuple2# a b
 (Int, Int) :: Tuple2 (*) (*)
 type T :: Tuple2 (*) (*)
-type T = (Int, Int) :: Tuple2 (*) (*)
+type T = (Int, Int)
   	-- Defined at <interactive>:18:1
 type S :: Solo (*)
-type S = MkSolo Int :: Solo (*)
+type S = MkSolo Int
   	-- Defined at <interactive>:19:1
 type L :: List (*)
-type L = [Int] :: List (*)
+type L = [Int]
   	-- Defined at <interactive>:20:1
 f :: Int -> Tuple2 Int Int -> Int
 (\ (_, _) -> ()) :: Tuple2 a b -> Unit


=====================================
testsuite/tests/ghci/scripts/T15941.stdout
=====================================
@@ -1,4 +1,3 @@
 type T :: * -> * -> *
-type T =
-  (->) @{GHC.Types.LiftedRep} @{GHC.Types.LiftedRep} :: * -> * -> *
+type T = (->) @{GHC.Types.LiftedRep} @{GHC.Types.LiftedRep}
   	-- Defined at <interactive>:2:1


=====================================
testsuite/tests/ghci/scripts/T19310.stdout
=====================================
@@ -1,3 +1,3 @@
 type T :: * -> * -> *
-type T = (->) @{LiftedRep} @{LiftedRep} :: * -> * -> *
+type T = (->) @{LiftedRep} @{LiftedRep}
   	-- Defined at <interactive>:3:1


=====================================
testsuite/tests/ghci/scripts/T21294a.stdout
=====================================
@@ -1,5 +1,5 @@
 type L0 :: * -> *
-type L0 = [] :: * -> *
+type L0 = []
   	-- Defined at <interactive>:1:1
 type L1 :: * -> *
 type L1 a = [a]


=====================================
testsuite/tests/ghci/scripts/T24459.script
=====================================
@@ -0,0 +1,36 @@
+:set -XTypeAbstractions
+
+:{
+import Data.Kind
+import Data.Data
+
+
+type T6 :: forall k. Type -> Type
+type T6 _a = ()
+
+type T5 :: forall a. Type -> Type
+type T5 @a _b = Proxy _b
+
+type T4 :: forall a. Type -> Type
+type T4 @a _b = Proxy a
+
+type T3 :: forall k. k -> Type
+type T3 a = Proxy a
+
+type T2 :: forall k. k -> Type
+type T2 @k = Proxy
+
+type T1 :: forall k. k -> Type
+type T1 = Proxy
+
+type T0 :: forall k. k -> Type
+type T0 = Proxy :: forall k. k -> Type
+:}
+
+:i T0
+:i T1
+:i T2
+:i T3
+:i T4
+:i T5
+:i T6


=====================================
testsuite/tests/ghci/scripts/T24459.stdout
=====================================
@@ -0,0 +1,21 @@
+type T0 :: forall k. k -> *
+type T0 = Proxy
+  	-- Defined at <interactive>:27:1
+type T1 :: forall k. k -> *
+type T1 = Proxy
+  	-- Defined at <interactive>:24:1
+type T2 :: forall k. k -> *
+type T2 @k = Proxy
+  	-- Defined at <interactive>:21:1
+type T3 :: forall k. k -> *
+type T3 a = Proxy a
+  	-- Defined at <interactive>:18:1
+type T4 :: forall {k} (a :: k). * -> *
+type T4 @a _b = Proxy a
+  	-- Defined at <interactive>:15:1
+type T5 :: forall {k} (a :: k). * -> *
+type T5 _b = Proxy _b
+  	-- Defined at <interactive>:12:1
+type T6 :: forall {k} (k1 :: k). * -> *
+type T6 _a = ()
+  	-- Defined at <interactive>:9:1


=====================================
testsuite/tests/ghci/scripts/T8535.stdout
=====================================
@@ -1,5 +1,5 @@
 type (->) :: * -> * -> *
-type (->) = FUN Many :: * -> * -> *
+type (->) = FUN Many
   	-- Defined in ‘GHC.Types’
 infixr -1 ->
 instance Monoid b => Monoid (a -> b)


=====================================
testsuite/tests/ghci/scripts/T9181.stdout
=====================================
@@ -13,12 +13,10 @@ type (GHC.Internal.Data.Type.Ord.<=) x y =
   GHC.Internal.TypeError.Assert
     (x GHC.Internal.Data.Type.Ord.<=? y)
     (GHC.Internal.Data.Type.Ord.LeErrMsg x y)
-  :: Constraint
 type (GHC.Internal.Data.Type.Ord.<=?) :: forall k. k -> k -> Bool
 type (GHC.Internal.Data.Type.Ord.<=?) m n =
   GHC.Internal.Data.Type.Ord.OrdCond
     (GHC.Internal.Data.Type.Ord.Compare m n) True True False
-  :: Bool
 type GHC.Internal.TypeLits.AppendSymbol :: GHC.Types.Symbol
                                            -> GHC.Types.Symbol -> GHC.Types.Symbol
 type family GHC.Internal.TypeLits.AppendSymbol a b


=====================================
testsuite/tests/ghci/scripts/all.T
=====================================
@@ -384,3 +384,4 @@ test('T23686', normal, ghci_script, ['T23686.script'])
 test('T13869', extra_files(['T13869a.hs', 'T13869b.hs']), ghci_script, ['T13869.script'])
 test('ListTuplePunsPpr', normal, ghci_script, ['ListTuplePunsPpr.script'])
 test('ListTuplePunsPprNoAbbrevTuple', [expect_broken(23135), limit_stdout_lines(13)], ghci_script, ['ListTuplePunsPprNoAbbrevTuple.script'])
+test('T24459', normal, ghci_script, ['T24459.script'])


=====================================
testsuite/tests/ghci/scripts/ghci020.stdout
=====================================
@@ -1,5 +1,5 @@
 type (->) :: * -> * -> *
-type (->) = FUN Many :: * -> * -> *
+type (->) = FUN Many
   	-- Defined in ‘GHC.Types’
 infixr -1 ->
 instance Monoid b => Monoid (a -> b)


=====================================
testsuite/tests/ghci/should_run/T10145.stdout
=====================================
@@ -1,5 +1,5 @@
 type (->) :: * -> * -> *
-type (->) = FUN Many :: * -> * -> *
+type (->) = FUN Many
   	-- Defined in ‘GHC.Types’
 infixr -1 ->
 instance Monoid b => Monoid (a -> b)


=====================================
testsuite/tests/ghci/should_run/T18594.stdout
=====================================
@@ -1,5 +1,5 @@
 type (->) :: * -> * -> *
-type (->) = FUN Many :: * -> * -> *
+type (->) = FUN Many
   	-- Defined in ‘GHC.Types’
 infixr -1 ->
 instance Monoid b => Monoid (a -> b)


=====================================
testsuite/tests/interface-stability/base-exports.stdout
=====================================
@@ -1760,27 +1760,27 @@ module Data.Type.Equality where
 module Data.Type.Ord where
   -- Safety: Safe
   type (<) :: forall {t}. t -> t -> Constraint
-  type (<) x y = GHC.Internal.TypeError.Assert (x <? y) (GHC.Internal.Data.Type.Ord.LtErrMsg x y) :: Constraint
+  type (<) x y = GHC.Internal.TypeError.Assert (x <? y) (GHC.Internal.Data.Type.Ord.LtErrMsg x y)
   type (<=) :: forall {t}. t -> t -> Constraint
-  type (<=) x y = GHC.Internal.TypeError.Assert (x <=? y) (GHC.Internal.Data.Type.Ord.LeErrMsg x y) :: Constraint
+  type (<=) x y = GHC.Internal.TypeError.Assert (x <=? y) (GHC.Internal.Data.Type.Ord.LeErrMsg x y)
   type (<=?) :: forall k. k -> k -> GHC.Types.Bool
-  type (<=?) m n = OrdCond (Compare m n) GHC.Types.True GHC.Types.True GHC.Types.False :: GHC.Types.Bool
+  type (<=?) m n = OrdCond (Compare m n) GHC.Types.True GHC.Types.True GHC.Types.False
   type (<?) :: forall k. k -> k -> GHC.Types.Bool
-  type (<?) m n = OrdCond (Compare m n) GHC.Types.True GHC.Types.False GHC.Types.False :: GHC.Types.Bool
+  type (<?) m n = OrdCond (Compare m n) GHC.Types.True GHC.Types.False GHC.Types.False
   type (>) :: forall {t}. t -> t -> Constraint
-  type (>) x y = GHC.Internal.TypeError.Assert (x >? y) (GHC.Internal.Data.Type.Ord.GtErrMsg x y) :: Constraint
+  type (>) x y = GHC.Internal.TypeError.Assert (x >? y) (GHC.Internal.Data.Type.Ord.GtErrMsg x y)
   type (>=) :: forall {t}. t -> t -> Constraint
-  type (>=) x y = GHC.Internal.TypeError.Assert (x >=? y) (GHC.Internal.Data.Type.Ord.GeErrMsg x y) :: Constraint
+  type (>=) x y = GHC.Internal.TypeError.Assert (x >=? y) (GHC.Internal.Data.Type.Ord.GeErrMsg x y)
   type (>=?) :: forall k. k -> k -> GHC.Types.Bool
-  type (>=?) m n = OrdCond (Compare m n) GHC.Types.False GHC.Types.True GHC.Types.True :: GHC.Types.Bool
+  type (>=?) m n = OrdCond (Compare m n) GHC.Types.False GHC.Types.True GHC.Types.True
   type (>?) :: forall k. k -> k -> GHC.Types.Bool
-  type (>?) m n = OrdCond (Compare m n) GHC.Types.False GHC.Types.False GHC.Types.True :: GHC.Types.Bool
+  type (>?) m n = OrdCond (Compare m n) GHC.Types.False GHC.Types.False GHC.Types.True
   type Compare :: forall k. k -> k -> GHC.Types.Ordering
   type family Compare a b
   type Max :: forall k. k -> k -> k
-  type Max m n = OrdCond (Compare m n) n n m :: k
+  type Max m n = OrdCond (Compare m n) n n m
   type Min :: forall k. k -> k -> k
-  type Min m n = OrdCond (Compare m n) m m n :: k
+  type Min m n = OrdCond (Compare m n) m m n
   type OrdCond :: forall k. GHC.Types.Ordering -> k -> k -> k -> k
   type family OrdCond o lt eq gt where
     forall k (lt :: k) (eq :: k) (gt :: k). OrdCond GHC.Types.LT lt eq gt = lt
@@ -3315,7 +3315,7 @@ module GHC.Base where
   type Levity :: *
   data Levity = Lifted | Unlifted
   type LiftedRep :: RuntimeRep
-  type LiftedRep = BoxedRep Lifted :: RuntimeRep
+  type LiftedRep = BoxedRep Lifted
   type List :: * -> *
   data List a = ...
   type role MVar# nominal representational
@@ -3428,7 +3428,7 @@ module GHC.Base where
   type TypeLitSort :: *
   data TypeLitSort = TypeLitSymbol | TypeLitNat | TypeLitChar
   type UnliftedRep :: RuntimeRep
-  type UnliftedRep = BoxedRep Unlifted :: RuntimeRep
+  type UnliftedRep = BoxedRep Unlifted
   type UnliftedType :: *
   type UnliftedType = TYPE UnliftedRep
   type VecCount :: *
@@ -3438,7 +3438,7 @@ module GHC.Base where
   type Void :: *
   data Void
   type Void# :: ZeroBitType
-  type Void# = (# #) :: ZeroBitType
+  type Void# = (# #)
   type Weak# :: forall {l :: Levity}. TYPE (BoxedRep l) -> UnliftedType
   data Weak# a
   type WithDict :: Constraint -> * -> Constraint
@@ -3484,7 +3484,7 @@ module GHC.Base where
   type WordBox :: TYPE WordRep -> *
   data WordBox a = MkWordBox a
   type ZeroBitRep :: RuntimeRep
-  type ZeroBitRep = TupleRep '[] :: RuntimeRep
+  type ZeroBitRep = TupleRep '[]
   type ZeroBitType :: *
   type ZeroBitType = TYPE ZeroBitRep
   absentErr :: forall a. a
@@ -5513,7 +5513,7 @@ module GHC.Exts where
   type Levity :: *
   data Levity = Lifted | Unlifted
   type LiftedRep :: RuntimeRep
-  type LiftedRep = BoxedRep Lifted :: RuntimeRep
+  type LiftedRep = BoxedRep Lifted
   type List :: * -> *
   data List a = ...
   type role MVar# nominal representational
@@ -5588,7 +5588,7 @@ module GHC.Exts where
   TypeLitNat :: GHC.Types.TypeLitSort
   TypeLitSymbol :: GHC.Types.TypeLitSort
   type UnliftedRep :: RuntimeRep
-  type UnliftedRep = BoxedRep Unlifted :: RuntimeRep
+  type UnliftedRep = BoxedRep Unlifted
   type UnliftedType :: *
   type UnliftedType = TYPE UnliftedRep
   type VecCount :: *
@@ -5596,7 +5596,7 @@ module GHC.Exts where
   type VecElem :: *
   data VecElem = Int8ElemRep | Int16ElemRep | Int32ElemRep | Int64ElemRep | Word8ElemRep | Word16ElemRep | Word32ElemRep | Word64ElemRep | FloatElemRep | DoubleElemRep
   type Void# :: ZeroBitType
-  type Void# = (# #) :: ZeroBitType
+  type Void# = (# #)
   type Weak# :: forall {l :: Levity}. TYPE (BoxedRep l) -> UnliftedType
   data Weak# a
   type WithDict :: Constraint -> * -> Constraint
@@ -5642,7 +5642,7 @@ module GHC.Exts where
   type WordBox :: TYPE WordRep -> *
   data WordBox a = MkWordBox a
   type ZeroBitRep :: RuntimeRep
-  type ZeroBitRep = TupleRep '[] :: RuntimeRep
+  type ZeroBitRep = TupleRep '[]
   type ZeroBitType :: *
   type ZeroBitType = TYPE ZeroBitRep
   acosDouble# :: Double# -> Double#
@@ -7377,7 +7377,7 @@ module GHC.Generics where
   type C :: *
   data C
   type C1 :: forall {k}. Meta -> (k -> *) -> k -> *
-  type C1 = M1 C :: Meta -> (k -> *) -> k -> *
+  type C1 = M1 C
   type Constructor :: forall {k}. k -> Constraint
   class Constructor c where
     conName :: forall k1 (t :: k -> (k1 -> *) -> k1 -> *) (f :: k1 -> *) (a :: k1). t c f a -> [GHC.Types.Char]
@@ -7387,7 +7387,7 @@ module GHC.Generics where
   type D :: *
   data D
   type D1 :: forall {k}. Meta -> (k -> *) -> k -> *
-  type D1 = M1 D :: Meta -> (k -> *) -> k -> *
+  type D1 = M1 D
   type Datatype :: forall {k}. k -> Constraint
   class Datatype d where
     datatypeName :: forall k1 (t :: k -> (k1 -> *) -> k1 -> *) (f :: k1 -> *) (a :: k1). t d f a -> [GHC.Types.Char]
@@ -7434,14 +7434,14 @@ module GHC.Generics where
   type R :: *
   data R
   type Rec0 :: forall {k}. * -> k -> *
-  type Rec0 = K1 R :: * -> k -> *
+  type Rec0 = K1 R
   type role Rec1 representational nominal
   type Rec1 :: forall k. (k -> *) -> k -> *
   newtype Rec1 f p = Rec1 {unRec1 :: f p}
   type S :: *
   data S
   type S1 :: forall {k}. Meta -> (k -> *) -> k -> *
-  type S1 = M1 S :: Meta -> (k -> *) -> k -> *
+  type S1 = M1 S
   type Selector :: forall {k}. k -> Constraint
   class Selector s where
     selName :: forall k1 (t :: k -> (k1 -> *) -> k1 -> *) (f :: k1 -> *) (a :: k1). t s f a -> [GHC.Types.Char]
@@ -7458,24 +7458,24 @@ module GHC.Generics where
   data U1 p = U1
   UAddr :: forall k (p :: k). GHC.Prim.Addr# -> URec (GHC.Internal.Ptr.Ptr ()) p
   type UAddr :: forall {k}. k -> *
-  type UAddr = URec (GHC.Internal.Ptr.Ptr ()) :: k -> *
+  type UAddr = URec (GHC.Internal.Ptr.Ptr ())
   UChar :: forall k (p :: k). GHC.Prim.Char# -> URec GHC.Types.Char p
   type UChar :: forall {k}. k -> *
-  type UChar = URec GHC.Types.Char :: k -> *
+  type UChar = URec GHC.Types.Char
   UDouble :: forall k (p :: k). GHC.Prim.Double# -> URec GHC.Types.Double p
   type UDouble :: forall {k}. k -> *
-  type UDouble = URec GHC.Types.Double :: k -> *
+  type UDouble = URec GHC.Types.Double
   UFloat :: forall k (p :: k). GHC.Prim.Float# -> URec GHC.Types.Float p
   type UFloat :: forall {k}. k -> *
-  type UFloat = URec GHC.Types.Float :: k -> *
+  type UFloat = URec GHC.Types.Float
   UInt :: forall k (p :: k). GHC.Prim.Int# -> URec GHC.Types.Int p
   type UInt :: forall {k}. k -> *
-  type UInt = URec GHC.Types.Int :: k -> *
+  type UInt = URec GHC.Types.Int
   type URec :: forall k. * -> k -> *
   data family URec a p
   UWord :: forall k (p :: k). GHC.Prim.Word# -> URec GHC.Types.Word p
   type UWord :: forall {k}. k -> *
-  type UWord = URec GHC.Types.Word :: k -> *
+  type UWord = URec GHC.Types.Word
   type role V1 phantom
   type V1 :: forall k. k -> *
   data V1 p
@@ -8563,7 +8563,7 @@ module GHC.Num.BigNat where
   type BigNat :: *
   data BigNat = BN# {unBigNat :: BigNat#}
   type BigNat# :: GHC.Types.UnliftedType
-  type BigNat# = GHC.Num.WordArray.WordArray# :: GHC.Types.UnliftedType
+  type BigNat# = GHC.Num.WordArray.WordArray#
   bigNatAdd :: BigNat# -> BigNat# -> BigNat#
   bigNatAddWord :: BigNat# -> GHC.Types.Word -> BigNat#
   bigNatAddWord# :: BigNat# -> GHC.Prim.Word# -> BigNat#
@@ -9345,7 +9345,7 @@ module GHC.Stack where
   type CostCentreStack :: *
   data CostCentreStack
   type HasCallStack :: Constraint
-  type HasCallStack = ?callStack::CallStack :: Constraint
+  type HasCallStack = ?callStack::CallStack
   type SrcLoc :: *
   data SrcLoc = SrcLoc {srcLocPackage :: [GHC.Types.Char], srcLocModule :: [GHC.Types.Char], srcLocFile :: [GHC.Types.Char], srcLocStartLine :: GHC.Types.Int, srcLocStartCol :: GHC.Types.Int, srcLocEndLine :: GHC.Types.Int, srcLocEndCol :: GHC.Types.Int}
   callStack :: HasCallStack => CallStack
@@ -9406,7 +9406,7 @@ module GHC.Stack.Types where
   type CallStack :: *
   data CallStack = EmptyCallStack | PushCallStack [GHC.Types.Char] SrcLoc CallStack | FreezeCallStack CallStack
   type HasCallStack :: Constraint
-  type HasCallStack = ?callStack::CallStack :: Constraint
+  type HasCallStack = ?callStack::CallStack
   type SrcLoc :: *
   data SrcLoc = SrcLoc {srcLocPackage :: [GHC.Types.Char], srcLocModule :: [GHC.Types.Char], srcLocFile :: [GHC.Types.Char], srcLocStartLine :: GHC.Types.Int, srcLocStartCol :: GHC.Types.Int, srcLocEndLine :: GHC.Types.Int, srcLocEndCol :: GHC.Types.Int}
   emptyCallStack :: CallStack
@@ -9561,9 +9561,9 @@ module GHC.TypeLits where
   type (-) :: Natural -> Natural -> Natural
   type family (-) a b
   type (<=) :: forall {t}. t -> t -> Constraint
-  type (<=) x y = GHC.Internal.TypeError.Assert (x <=? y) (GHC.Internal.Data.Type.Ord.LeErrMsg x y) :: Constraint
+  type (<=) x y = GHC.Internal.TypeError.Assert (x <=? y) (GHC.Internal.Data.Type.Ord.LeErrMsg x y)
   type (<=?) :: forall k. k -> k -> GHC.Types.Bool
-  type (<=?) m n = GHC.Internal.Data.Type.Ord.OrdCond (GHC.Internal.Data.Type.Ord.Compare m n) GHC.Types.True GHC.Types.True GHC.Types.False :: GHC.Types.Bool
+  type (<=?) m n = GHC.Internal.Data.Type.Ord.OrdCond (GHC.Internal.Data.Type.Ord.Compare m n) GHC.Types.True GHC.Types.True GHC.Types.False
   type AppendSymbol :: Symbol -> Symbol -> Symbol
   type family AppendSymbol a b
   type CharToNat :: GHC.Types.Char -> Natural
@@ -9680,9 +9680,9 @@ module GHC.TypeNats where
   type (-) :: Natural -> Natural -> Natural
   type family (-) a b
   type (<=) :: forall {t}. t -> t -> Constraint
-  type (<=) x y = GHC.Internal.TypeError.Assert (x <=? y) (GHC.Internal.Data.Type.Ord.LeErrMsg x y) :: Constraint
+  type (<=) x y = GHC.Internal.TypeError.Assert (x <=? y) (GHC.Internal.Data.Type.Ord.LeErrMsg x y)
   type (<=?) :: forall k. k -> k -> GHC.Types.Bool
-  type (<=?) m n = GHC.Internal.Data.Type.Ord.OrdCond (GHC.Internal.Data.Type.Ord.Compare m n) GHC.Types.True GHC.Types.True GHC.Types.False :: GHC.Types.Bool
+  type (<=?) m n = GHC.Internal.Data.Type.Ord.OrdCond (GHC.Internal.Data.Type.Ord.Compare m n) GHC.Types.True GHC.Types.True GHC.Types.False
   type CmpNat :: Natural -> Natural -> GHC.Types.Ordering
   type family CmpNat a b
   type Div :: Natural -> Natural -> Natural


=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -1480,9 +1480,9 @@ module Data.Tuple.Experimental where
   class a => CSolo a
     {-# MINIMAL #-}
   type CTuple0 :: Constraint
-  type CTuple0 = () :: Constraint :: Constraint
+  type CTuple0 = () :: Constraint
   type CTuple1 :: Constraint -> Constraint
-  type CTuple1 = CSolo :: Constraint -> Constraint
+  type CTuple1 = CSolo
   type CTuple10 :: Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint
   class (a, b, c, d, e, f, g, h, i, j) => CTuple10 a b c d e f g h i j
     {-# MINIMAL #-}
@@ -2637,11 +2637,11 @@ module Data.Tuple.Experimental where
   type Tuple0 :: *
   type Tuple0 = ()
   type Tuple0# :: GHC.Types.ZeroBitType
-  type Tuple0# = (# #) :: GHC.Types.ZeroBitType
+  type Tuple0# = (# #)
   type Tuple1 :: * -> *
-  type Tuple1 = Solo :: * -> *
+  type Tuple1 = Solo
   type Tuple1# :: * -> TYPE (GHC.Types.TupleRep '[GHC.Types.LiftedRep])
-  type Tuple1# = Solo# :: * -> TYPE (GHC.Types.TupleRep '[GHC.Types.LiftedRep])
+  type Tuple1# = Solo#
   type Tuple10 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
   data Tuple10 a b c d e f g h i j = ...
   type Tuple10# :: forall (k0 :: GHC.Types.RuntimeRep) (k1 :: GHC.Types.RuntimeRep) (k2 :: GHC.Types.RuntimeRep) (k3 :: GHC.Types.RuntimeRep) (k4 :: GHC.Types.RuntimeRep) (k5 :: GHC.Types.RuntimeRep) (k6 :: GHC.Types.RuntimeRep) (k7 :: GHC.Types.RuntimeRep) (k8 :: GHC.Types.RuntimeRep) (k9 :: GHC.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Types.TupleRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9])
@@ -4328,9 +4328,9 @@ module Prelude.Experimental where
   class a => CSolo a
     {-# MINIMAL #-}
   type CTuple0 :: Constraint
-  type CTuple0 = () :: Constraint :: Constraint
+  type CTuple0 = () :: Constraint
   type CTuple1 :: Constraint -> Constraint
-  type CTuple1 = CSolo :: Constraint -> Constraint
+  type CTuple1 = CSolo
   type CTuple10 :: Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint -> Constraint
   class (a, b, c, d, e, f, g, h, i, j) => CTuple10 a b c d e f g h i j
     {-# MINIMAL #-}
@@ -6959,11 +6959,11 @@ module Prelude.Experimental where
   type Tuple0 :: *
   type Tuple0 = ()
   type Tuple0# :: GHC.Types.ZeroBitType
-  type Tuple0# = (# #) :: GHC.Types.ZeroBitType
+  type Tuple0# = (# #)
   type Tuple1 :: * -> *
-  type Tuple1 = Solo :: * -> *
+  type Tuple1 = Solo
   type Tuple1# :: * -> TYPE (GHC.Types.TupleRep '[GHC.Types.LiftedRep])
-  type Tuple1# = Solo# :: * -> TYPE (GHC.Types.TupleRep '[GHC.Types.LiftedRep])
+  type Tuple1# = Solo#
   type Tuple10 :: * -> * -> * -> * -> * -> * -> * -> * -> * -> * -> *
   data Tuple10 a b c d e f g h i j = ...
   type Tuple10# :: forall (k0 :: GHC.Types.RuntimeRep) (k1 :: GHC.Types.RuntimeRep) (k2 :: GHC.Types.RuntimeRep) (k3 :: GHC.Types.RuntimeRep) (k4 :: GHC.Types.RuntimeRep) (k5 :: GHC.Types.RuntimeRep) (k6 :: GHC.Types.RuntimeRep) (k7 :: GHC.Types.RuntimeRep) (k8 :: GHC.Types.RuntimeRep) (k9 :: GHC.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Types.TupleRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9])


=====================================
testsuite/tests/rep-poly/RepPolyBackpack3.stderr
=====================================
@@ -1,19 +1,19 @@
 [1 of 3] Processing sig
-  [1 of 1] Compiling Sig[sig]         ( sig\Sig.hsig, nothing )
+  [1 of 1] Compiling Sig[sig]         ( sig/Sig.hsig, nothing )
 [2 of 3] Processing impl
   Instantiating impl
-  [1 of 1] Compiling Impl             ( impl\Impl.hs, RepPolyBackpack3.out\impl\Impl.o )
+  [1 of 1] Compiling Impl             ( impl/Impl.hs, RepPolyBackpack3.out/impl/Impl.o )
 [3 of 3] Processing main
   Instantiating main
   [1 of 1] Including sig[Sig=impl:Impl]
     Instantiating sig[Sig=impl:Impl]
-    [1 of 1] Compiling Sig[sig]         ( sig\Sig.hsig, RepPolyBackpack3.out\sig\sig-Absk5cIXTXe6UYhGMYGber\Sig.o )
+    [1 of 1] Compiling Sig[sig]         ( sig/Sig.hsig, RepPolyBackpack3.out/sig/sig-Absk5cIXTXe6UYhGMYGber/Sig.o )
 
 RepPolyBackpack3.bkp:17:5: error: [GHC-15843]
     • Type constructor ‘Rep’ has conflicting definitions in the module
       and its hsig file.
       Main module: type Rep :: GHC.Types.RuntimeRep
-                   type Rep = T :: GHC.Types.RuntimeRep
+                   type Rep = T
         Hsig file: type Rep :: GHC.Types.RuntimeRep
                    data Rep
       Illegal implementation of abstract data: Invalid type family ‘T’.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6227a9ce164538d2df0526d76420c45a695e5f03

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/6227a9ce164538d2df0526d76420c45a695e5f03
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240312/ab3e22eb/attachment-0001.html>


More information about the ghc-commits mailing list