diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-01-15 17:30:30 +0000 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-01-18 11:55:41 +0000 |
commit | ec8a188a927a4db2e709541765e5ef545eae284c (patch) | |
tree | cbde55cf4ee60e4265536aee730c7c41d668824e /testsuite/tests | |
parent | 6e0c0fd2e09c552bf38e22645347dbb2e7327e8e (diff) | |
download | haskell-ec8a188a927a4db2e709541765e5ef545eae284c.tar.gz |
Refactoring on IdInfo and system derived names
Some modest refactoring, triggered in part by Trac #11051
* Kill off PatSynId, ReflectionId in IdDetails
They were barely used, and only for pretty-printing
* Add helper function Id.mkExportedVanillaId, and use it
* Polish up OccName.isDerivedOccName, as a predicate for
definitions generated internally by GHC, which we
might not want to show to the user.
* Kill off unused OccName.mkDerivedTyConOcc
* Shorten the derived OccNames for newtype and data
instance axioms
* A bit of related refactoring around newFamInstAxiomName
Diffstat (limited to 'testsuite/tests')
27 files changed, 231 insertions, 104 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 0184513754..935285a0d1 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -26,7 +26,7 @@ a1 = GHC.Types.TrNameS "T2431"# -- RHS size: {terms: 3, types: 0, coercions: 0} T2431.$trModule :: GHC.Types.Module -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] +[GblId, Caf=NoCafRefs, Str=DmdType] T2431.$trModule = GHC.Types.Module a a1 -- RHS size: {terms: 2, types: 0, coercions: 0} @@ -36,7 +36,7 @@ a2 = GHC.Types.TrNameS "'Refl"# -- RHS size: {terms: 5, types: 0, coercions: 0} T2431.$tc'Refl :: GHC.Types.TyCon -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] +[GblId, Caf=NoCafRefs, Str=DmdType] T2431.$tc'Refl = GHC.Types.TyCon 15026191172322750497## 3898273167927206410## T2431.$trModule a2 @@ -48,7 +48,7 @@ a3 = GHC.Types.TrNameS ":~:"# -- RHS size: {terms: 5, types: 0, coercions: 0} T2431.$tc:~: :: GHC.Types.TyCon -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] +[GblId, Caf=NoCafRefs, Str=DmdType] T2431.$tc:~: = GHC.Types.TyCon 9759653149176674453## 12942818337407067047## T2431.$trModule a3 diff --git a/testsuite/tests/ghci/scripts/T4175.stdout b/testsuite/tests/ghci/scripts/T4175.stdout index dbf2f371dd..ef5b5c69c1 100644 --- a/testsuite/tests/ghci/scripts/T4175.stdout +++ b/testsuite/tests/ghci/scripts/T4175.stdout @@ -1,19 +1,19 @@ type family A a b Kind: * -> * -> * -- Defined at T4175.hs:7:1 -type instance A (B a) b = () -- Defined at T4175.hs:10:1 -type instance A (Maybe a) a = a -- Defined at T4175.hs:9:1 -type instance A Int Int = () -- Defined at T4175.hs:8:1 +type instance A (B a) b = () -- Defined at T4175.hs:10:15 +type instance A (Maybe a) a = a -- Defined at T4175.hs:9:15 +type instance A Int Int = () -- Defined at T4175.hs:8:15 data family B a -- Defined at T4175.hs:12:1 instance G B -- Defined at T4175.hs:34:10 data instance B () = MkB -- Defined at T4175.hs:13:15 -type instance A (B a) b = () -- Defined at T4175.hs:10:1 +type instance A (B a) b = () -- Defined at T4175.hs:10:15 class C a where type family D a b Kind: * -> * -> * -- Defined at T4175.hs:16:5 -type instance D () () = Bool -- Defined at T4175.hs:22:5 -type instance D Int () = String -- Defined at T4175.hs:19:5 +type instance D () () = Bool -- Defined at T4175.hs:22:10 +type instance D Int () = String -- Defined at T4175.hs:19:10 type family E a Kind: * -> * where @@ -29,8 +29,8 @@ instance Ord () -- Defined in ‘GHC.Classes’ instance Read () -- Defined in ‘GHC.Read’ instance Show () -- Defined in ‘GHC.Show’ instance Monoid () -- Defined in ‘GHC.Base’ -type instance D () () = Bool -- Defined at T4175.hs:22:5 -type instance D Int () = String -- Defined at T4175.hs:19:5 +type instance D () () = Bool -- Defined at T4175.hs:22:10 +type instance D Int () = String -- Defined at T4175.hs:19:10 data instance B () = MkB -- Defined at T4175.hs:13:15 data Maybe a = Nothing | Just a -- Defined in ‘GHC.Base’ instance Eq a => Eq (Maybe a) -- Defined in ‘GHC.Base’ @@ -43,7 +43,7 @@ instance Applicative Maybe -- Defined in ‘GHC.Base’ instance Foldable Maybe -- Defined in ‘Data.Foldable’ instance Traversable Maybe -- Defined in ‘Data.Traversable’ instance Monoid a => Monoid (Maybe a) -- Defined in ‘GHC.Base’ -type instance A (Maybe a) a = a -- Defined at T4175.hs:9:1 +type instance A (Maybe a) a = a -- Defined at T4175.hs:9:15 data Int = I# Int# -- Defined in ‘GHC.Types’ instance C Int -- Defined at T4175.hs:18:10 instance Bounded Int -- Defined in ‘GHC.Enum’ @@ -55,7 +55,7 @@ instance Ord Int -- Defined in ‘GHC.Classes’ instance Read Int -- Defined in ‘GHC.Read’ instance Real Int -- Defined in ‘GHC.Real’ instance Show Int -- Defined in ‘GHC.Show’ -type instance D Int () = String -- Defined at T4175.hs:19:5 -type instance A Int Int = () -- Defined at T4175.hs:8:1 +type instance D Int () = String -- Defined at T4175.hs:19:10 +type instance A Int Int = () -- Defined at T4175.hs:8:15 class Z a -- Defined at T4175.hs:28:1 instance F (Z a) -- Defined at T4175.hs:31:10 diff --git a/testsuite/tests/ghci/scripts/T7939.stdout b/testsuite/tests/ghci/scripts/T7939.stdout index ec6c75cca2..1e6c5b7548 100644 --- a/testsuite/tests/ghci/scripts/T7939.stdout +++ b/testsuite/tests/ghci/scripts/T7939.stdout @@ -6,7 +6,7 @@ Bar :: k -> * -> * type family F a Kind: * -> * -- Defined at T7939.hs:8:1 -type instance F Int = Bool -- Defined at T7939.hs:9:1 +type instance F Int = Bool -- Defined at T7939.hs:9:15 F :: * -> * type family G a Kind: * -> * diff --git a/testsuite/tests/indexed-types/should_compile/T3017.stderr b/testsuite/tests/indexed-types/should_compile/T3017.stderr index 1300626e17..68214e946e 100644 --- a/testsuite/tests/indexed-types/should_compile/T3017.stderr +++ b/testsuite/tests/indexed-types/should_compile/T3017.stderr @@ -1,5 +1,8 @@ TYPE SIGNATURES + Foo.L :: forall a. [a] -> ListColl a + empty :: forall c. Coll c => c emptyL :: forall a. ListColl a + insert :: forall c. Coll c => Elem c -> c -> c test2 :: forall c t t1. (Elem c ~ (t, t1), Coll c, Num t1, Num t) => c -> c TYPE CONSTRUCTORS @@ -12,7 +15,7 @@ TYPE CONSTRUCTORS data ListColl a = L [a] Kind: * -> * COERCION AXIOMS - axiom Foo.TFCo:R:ElemListColl :: + axiom Foo.D:R:ElemListColl :: Elem (ListColl a) = a -- Defined at T3017.hs:13:9 INSTANCES instance Coll (ListColl a) -- Defined at T3017.hs:12:11 @@ -20,4 +23,4 @@ FAMILY INSTANCES type Elem (ListColl a) Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/numeric/should_compile/T7116.stdout b/testsuite/tests/numeric/should_compile/T7116.stdout index 373e3c5ec8..7853fa128b 100644 --- a/testsuite/tests/numeric/should_compile/T7116.stdout +++ b/testsuite/tests/numeric/should_compile/T7116.stdout @@ -22,7 +22,7 @@ T7116.$trModule1 = GHC.Types.TrNameS "T7116"# -- RHS size: {terms: 3, types: 0, coercions: 0} T7116.$trModule :: GHC.Types.Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/partial-sigs/should_compile/ADT.stderr b/testsuite/tests/partial-sigs/should_compile/ADT.stderr index 0fe16d1ed5..0da9e2284a 100644 --- a/testsuite/tests/partial-sigs/should_compile/ADT.stderr +++ b/testsuite/tests/partial-sigs/should_compile/ADT.stderr @@ -1,4 +1,5 @@ TYPE SIGNATURES + ADT.Foo :: forall x y z. x -> y -> z -> Foo x y z bar :: Int -> Foo Bool () Int TYPE CONSTRUCTORS data Foo x y z = Foo x y z @@ -6,4 +7,4 @@ TYPE CONSTRUCTORS COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr index 9698ab2c10..6a2ac84f6c 100644 --- a/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr +++ b/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr @@ -1,15 +1,25 @@ TYPE SIGNATURES + DataFamilyInstanceLHS.A :: MyKind + DataFamilyInstanceLHS.B :: MyKind + DataFamilyInstanceLHS.SingA :: + forall (_ :: MyKind). + (_ ~ 'A) => + DataFamilyInstanceLHS.R:SingMyKind_ _ + DataFamilyInstanceLHS.SingB :: + forall (_ :: MyKind). + (_ ~ 'B) => + DataFamilyInstanceLHS.R:SingMyKind_ _ foo :: Sing 'A TYPE CONSTRUCTORS data MyKind = A | B Kind: * data family Sing (a :: k) COERCION AXIOMS - axiom DataFamilyInstanceLHS.TFCo:R:SingMyKind_ :: + axiom DataFamilyInstanceLHS.D:R:SingMyKind_0 :: Sing = DataFamilyInstanceLHS.R:SingMyKind_ -- Defined at DataFamilyInstanceLHS.hs:8:15 FAMILY INSTANCES data instance Sing Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr index 730c0ed571..b335118ed8 100644 --- a/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr +++ b/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr @@ -1,14 +1,24 @@ TYPE SIGNATURES + NamedWildcardInDataFamilyInstanceLHS.A :: MyKind + NamedWildcardInDataFamilyInstanceLHS.B :: MyKind + NamedWildcardInDataFamilyInstanceLHS.SingA :: + forall (_a :: MyKind). + (_a ~ 'A) => + NamedWildcardInDataFamilyInstanceLHS.R:SingMyKind_a _a + NamedWildcardInDataFamilyInstanceLHS.SingB :: + forall (_a :: MyKind). + (_a ~ 'B) => + NamedWildcardInDataFamilyInstanceLHS.R:SingMyKind_a _a TYPE CONSTRUCTORS data MyKind = A | B Kind: * data family Sing (a :: k) COERCION AXIOMS - axiom NamedWildcardInDataFamilyInstanceLHS.TFCo:R:SingMyKind_a :: + axiom NamedWildcardInDataFamilyInstanceLHS.D:R:SingMyKind_a0 :: Sing = NamedWildcardInDataFamilyInstanceLHS.R:SingMyKind_a -- Defined at NamedWildcardInDataFamilyInstanceLHS.hs:8:15 FAMILY INSTANCES data instance Sing Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr index 84a7b4a55a..c39ff6f254 100644 --- a/testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr +++ b/testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr @@ -4,11 +4,11 @@ TYPE CONSTRUCTORS Kind: * -> * where [_t] F _t = Int - axiom NamedWildcardInTypeFamilyInstanceLHS.TFCo:R:F + axiom NamedWildcardInTypeFamilyInstanceLHS.D:R:F COERCION AXIOMS - axiom NamedWildcardInTypeFamilyInstanceLHS.TFCo:R:F :: + axiom NamedWildcardInTypeFamilyInstanceLHS.D:R:F :: F _t = Int -- Defined at NamedWildcardInTypeFamilyInstanceLHS.hs:5:3 Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/partial-sigs/should_compile/SkipMany.stderr b/testsuite/tests/partial-sigs/should_compile/SkipMany.stderr index e67eeb095e..be635e620d 100644 --- a/testsuite/tests/partial-sigs/should_compile/SkipMany.stderr +++ b/testsuite/tests/partial-sigs/should_compile/SkipMany.stderr @@ -1,4 +1,6 @@ TYPE SIGNATURES + SkipMany.GenParser :: + forall tok st a. tok -> st -> a -> GenParser tok st a skipMany :: forall tok st a. GenParser tok st a -> GenParser tok st () skipMany' :: @@ -9,4 +11,4 @@ TYPE CONSTRUCTORS COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr index 2d5f52e357..0800286480 100644 --- a/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr +++ b/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr @@ -4,13 +4,13 @@ TYPE CONSTRUCTORS type family F a b open Kind: * -> * -> * COERCION AXIOMS - axiom TypeFamilyInstanceLHS.TFCo:R:FBool_ :: + axiom TypeFamilyInstanceLHS.D:R:FBool_ :: F Bool _ = Bool -- Defined at TypeFamilyInstanceLHS.hs:6:15 - axiom TypeFamilyInstanceLHS.TFCo:R:FInt_ :: + axiom TypeFamilyInstanceLHS.D:R:FInt_ :: F Int _ = Int -- Defined at TypeFamilyInstanceLHS.hs:5:15 FAMILY INSTANCES type instance F Int _ type instance F Bool _ Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr index ef67f90d8b..6ea24f009b 100644 --- a/testsuite/tests/roles/should_compile/Roles1.stderr +++ b/testsuite/tests/roles/should_compile/Roles1.stderr @@ -1,4 +1,11 @@ TYPE SIGNATURES + Roles1.K1 :: forall a. a -> T1 a + Roles1.K2 :: forall a. a -> T2 a + Roles1.K3 :: forall k (a :: k). T3 a + Roles1.K4 :: forall (a :: * -> *) b. a b -> T4 a b + Roles1.K5 :: forall a. a -> T5 a + Roles1.K6 :: forall k (a :: k). T6 a + Roles1.K7 :: forall k (a :: k) b. b -> T7 a b TYPE CONSTRUCTORS type role T1 nominal data T1 a = K1 a @@ -22,7 +29,7 @@ TYPE CONSTRUCTORS COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] ==================== Typechecker ==================== Roles1.$tcT7 diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr index 8b7a2c8ce8..31795bf90b 100644 --- a/testsuite/tests/roles/should_compile/Roles13.stderr +++ b/testsuite/tests/roles/should_compile/Roles13.stderr @@ -14,7 +14,7 @@ a1 = GHC.Types.TrNameS "Roles13"# -- RHS size: {terms: 3, types: 0, coercions: 0} Roles13.$trModule :: GHC.Types.Module -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] +[GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$trModule = GHC.Types.Module a a1 -- RHS size: {terms: 2, types: 0, coercions: 0} @@ -24,8 +24,10 @@ a2 = GHC.Types.TrNameS "'MkAge"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tc'MkAge :: GHC.Types.TyCon -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] -Roles13.$tc'MkAge = GHC.Types.TyCon 0## 0## Roles13.$trModule a2 +[GblId, Caf=NoCafRefs, Str=DmdType] +Roles13.$tc'MkAge = + GHC.Types.TyCon + 1226019810264079099## 12180888342844277416## Roles13.$trModule a2 -- RHS size: {terms: 2, types: 0, coercions: 0} a3 :: GHC.Types.TrName @@ -34,8 +36,10 @@ a3 = GHC.Types.TrNameS "Age"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tcAge :: GHC.Types.TyCon -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] -Roles13.$tcAge = GHC.Types.TyCon 0## 0## Roles13.$trModule a3 +[GblId, Caf=NoCafRefs, Str=DmdType] +Roles13.$tcAge = + GHC.Types.TyCon + 18304088376370610314## 1954648846714895105## Roles13.$trModule a3 -- RHS size: {terms: 2, types: 0, coercions: 0} a4 :: GHC.Types.TrName @@ -44,8 +48,10 @@ a4 = GHC.Types.TrNameS "'MkWrap"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tc'MkWrap :: GHC.Types.TyCon -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] -Roles13.$tc'MkWrap = GHC.Types.TyCon 0## 0## Roles13.$trModule a4 +[GblId, Caf=NoCafRefs, Str=DmdType] +Roles13.$tc'MkWrap = + GHC.Types.TyCon + 12402878715225676312## 13345418993613492500## Roles13.$trModule a4 -- RHS size: {terms: 2, types: 0, coercions: 0} a5 :: GHC.Types.TrName @@ -54,8 +60,10 @@ a5 = GHC.Types.TrNameS "Wrap"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tcWrap :: GHC.Types.TyCon -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] -Roles13.$tcWrap = GHC.Types.TyCon 0## 0## Roles13.$trModule a5 +[GblId, Caf=NoCafRefs, Str=DmdType] +Roles13.$tcWrap = + GHC.Types.TyCon + 5278920226786541118## 14554440859491798587## Roles13.$trModule a5 -- RHS size: {terms: 2, types: 2, coercions: 0} a6 :: Wrap Age -> Wrap Age @@ -67,7 +75,7 @@ convert :: Wrap Age -> Int [GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] convert = a6 - `cast` (<Wrap Age>_R -> Roles13.NTCo:Wrap[0] Roles13.NTCo:Age[0] + `cast` (<Wrap Age>_R -> Roles13.N:Wrap[0] Roles13.N:Age[0] :: (Wrap Age -> Wrap Age) ~R# (Wrap Age -> Int)) diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index aeff4498ba..b34194db79 100644 --- a/testsuite/tests/roles/should_compile/Roles14.stderr +++ b/testsuite/tests/roles/should_compile/Roles14.stderr @@ -1,22 +1,29 @@ TYPE SIGNATURES + meth2 :: forall a. C2 a => a -> a TYPE CONSTRUCTORS type role C2 representational class C2 a where meth2 :: a -> a {-# MINIMAL meth2 #-} COERCION AXIOMS - axiom Roles12.NTCo:C2 :: C2 a = a -> a -- Defined at Roles14.hs:6:1 + axiom Roles12.N:C2 :: C2 a = a -> a -- Defined at Roles14.hs:6:1 Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] ==================== Typechecker ==================== Roles12.$tcC2 = GHC.Types.TyCon - 0## 0## Roles12.$trModule (GHC.Types.TrNameS "C2"#) -Roles12.$tc'D:C2 + 4006088231579841122## + 4783761708993822739## + Roles12.$trModule + (GHC.Types.TrNameS "C2"#) +Roles12.$tc'C:C2 = GHC.Types.TyCon - 0## 0## Roles12.$trModule (GHC.Types.TrNameS "'D:C2"#) + 5555822832309788726## + 2795860317217328413## + Roles12.$trModule + (GHC.Types.TrNameS "'C:C2"#) Roles12.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles12"#) diff --git a/testsuite/tests/roles/should_compile/Roles2.stderr b/testsuite/tests/roles/should_compile/Roles2.stderr index 14d24b0150..7c075b9bce 100644 --- a/testsuite/tests/roles/should_compile/Roles2.stderr +++ b/testsuite/tests/roles/should_compile/Roles2.stderr @@ -1,4 +1,6 @@ TYPE SIGNATURES + Roles2.K1 :: forall a. IO a -> T1 a + Roles2.K2 :: forall a. FunPtr a -> T2 a TYPE CONSTRUCTORS data T1 a = K1 (IO a) Kind: * -> * @@ -8,21 +10,33 @@ TYPE CONSTRUCTORS COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] ==================== Typechecker ==================== Roles2.$tcT2 = GHC.Types.TyCon - 0## 0## Roles2.$trModule (GHC.Types.TrNameS "T2"#) + 5934726586329293381## + 1923031187495159753## + Roles2.$trModule + (GHC.Types.TrNameS "T2"#) Roles2.$tc'K2 = GHC.Types.TyCon - 0## 0## Roles2.$trModule (GHC.Types.TrNameS "'K2"#) + 1362115092449420584## + 15899377929296700609## + Roles2.$trModule + (GHC.Types.TrNameS "'K2"#) Roles2.$tcT1 = GHC.Types.TyCon - 0## 0## Roles2.$trModule (GHC.Types.TrNameS "T1"#) + 13879106829711353992## + 15151456821588362072## + Roles2.$trModule + (GHC.Types.TrNameS "T1"#) Roles2.$tc'K1 = GHC.Types.TyCon - 0## 0## Roles2.$trModule (GHC.Types.TrNameS "'K1"#) + 14735176013935828521## + 17563925141462511949## + Roles2.$trModule + (GHC.Types.TrNameS "'K1"#) Roles2.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles2"#) diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index bf6dd003e9..544e497c2d 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -1,4 +1,8 @@ TYPE SIGNATURES + meth1 :: forall a. C1 a => a -> a + meth2 :: forall a b. (C2 a b, a ~ b) => a -> b + meth3 :: forall a b. C3 a b => a -> F3 b -> F3 b + meth4 :: forall a b. C4 a b => a -> F4 b -> F4 b TYPE CONSTRUCTORS class C1 a where meth1 :: a -> a @@ -19,42 +23,66 @@ TYPE CONSTRUCTORS type Syn1 a = F4 a type Syn2 a = [a] COERCION AXIOMS - axiom Roles3.NTCo:C1 :: C1 a = a -> a -- Defined at Roles3.hs:6:1 - axiom Roles3.NTCo:C2 :: + axiom Roles3.N:C1 :: C1 a = a -> a -- Defined at Roles3.hs:6:1 + axiom Roles3.N:C2 :: C2 a b = (a ~ b) => a -> b -- Defined at Roles3.hs:9:1 - axiom Roles3.NTCo:C3 :: + axiom Roles3.N:C3 :: C3 a b = a -> F3 b -> F3 b -- Defined at Roles3.hs:12:1 - axiom Roles3.NTCo:C4 :: + axiom Roles3.N:C4 :: C4 a b = a -> F4 b -> F4 b -- Defined at Roles3.hs:18:1 Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] ==================== Typechecker ==================== Roles3.$tcC4 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "C4"#) -Roles3.$tc'D:C4 + 12861862461396457184## + 6389612623460961504## + Roles3.$trModule + (GHC.Types.TrNameS "C4"#) +Roles3.$tc'C:C4 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "'D:C4"#) + 5012080351591218464## + 14312195554521420369## + Roles3.$trModule + (GHC.Types.TrNameS "'C:C4"#) Roles3.$tcC3 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "C3"#) -Roles3.$tc'D:C3 + 5998139369941479154## + 6816352641934636458## + Roles3.$trModule + (GHC.Types.TrNameS "C3"#) +Roles3.$tc'C:C3 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "'D:C3"#) + 5363370173992879615## + 3444510123613553605## + Roles3.$trModule + (GHC.Types.TrNameS "'C:C3"#) Roles3.$tcC2 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "C2"#) -Roles3.$tc'D:C2 + 8833962732139387711## + 7891126688522429937## + Roles3.$trModule + (GHC.Types.TrNameS "C2"#) +Roles3.$tc'C:C2 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "'D:C2"#) + 17372867324718144313## + 13604113872247370917## + Roles3.$trModule + (GHC.Types.TrNameS "'C:C2"#) Roles3.$tcC1 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "C1"#) -Roles3.$tc'D:C1 + 16242970448469140073## + 10229725431456576413## + Roles3.$trModule + (GHC.Types.TrNameS "C1"#) +Roles3.$tc'C:C1 = GHC.Types.TyCon - 0## 0## Roles3.$trModule (GHC.Types.TrNameS "'D:C1"#) + 2927144765823607117## + 15172069236577673237## + Roles3.$trModule + (GHC.Types.TrNameS "'C:C1"#) Roles3.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles3"#) diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index 7253f93507..6a336da26b 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -1,4 +1,6 @@ TYPE SIGNATURES + meth1 :: forall a. C1 a => a -> a + meth3 :: forall a. C3 a => a -> Syn1 a TYPE CONSTRUCTORS class C1 a where meth1 :: a -> a @@ -8,26 +10,38 @@ TYPE CONSTRUCTORS {-# MINIMAL meth3 #-} type Syn1 a = [a] COERCION AXIOMS - axiom Roles4.NTCo:C1 :: C1 a = a -> a -- Defined at Roles4.hs:6:1 - axiom Roles4.NTCo:C3 :: + axiom Roles4.N:C1 :: C1 a = a -> a -- Defined at Roles4.hs:6:1 + axiom Roles4.N:C3 :: C3 a = a -> Syn1 a -- Defined at Roles4.hs:11:1 Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] ==================== Typechecker ==================== Roles4.$tcC3 = GHC.Types.TyCon - 0## 0## Roles4.$trModule (GHC.Types.TrNameS "C3"#) -Roles4.$tc'D:C3 + 16502190608089501863## + 13971441568961069854## + Roles4.$trModule + (GHC.Types.TrNameS "C3"#) +Roles4.$tc'C:C3 = GHC.Types.TyCon - 0## 0## Roles4.$trModule (GHC.Types.TrNameS "'D:C3"#) + 16482122951248115051## + 8497036782794772516## + Roles4.$trModule + (GHC.Types.TrNameS "'C:C3"#) Roles4.$tcC1 = GHC.Types.TyCon - 0## 0## Roles4.$trModule (GHC.Types.TrNameS "C1"#) -Roles4.$tc'D:C1 + 11951908835899020229## + 6518430686554778113## + Roles4.$trModule + (GHC.Types.TrNameS "C1"#) +Roles4.$tc'C:C1 = GHC.Types.TyCon - 0## 0## Roles4.$trModule (GHC.Types.TrNameS "'D:C1"#) + 11393997571952951642## + 4382794907973051606## + Roles4.$trModule + (GHC.Types.TrNameS "'C:C1"#) Roles4.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "Roles4"#) diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index ba97e8a45f..4434b1ee74 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -2,6 +2,7 @@ T8958.hs:1:31: warning: -XDatatypeContexts is deprecated: It was widely considered a misfeature, and has been removed from the Haskell language. TYPE SIGNATURES + T8958.MkMap :: forall k v. [(k, v)] -> Map k v TYPE CONSTRUCTORS type role Map nominal representational newtype (Nominal k, Representational v) => Map k v = MkMap [(k, v)] @@ -10,35 +11,52 @@ TYPE CONSTRUCTORS type role Representational representational class Representational a COERCION AXIOMS - axiom T8958.NTCo:Map :: - Map k v = [(k, v)] -- Defined at T8958.hs:13:1 + axiom T8958.N:Map :: Map k v = [(k, v)] -- Defined at T8958.hs:13:1 INSTANCES instance [incoherent] Nominal a -- Defined at T8958.hs:7:10 instance [incoherent] Representational a -- Defined at T8958.hs:10:10 Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] ==================== Typechecker ==================== T8958.$tcMap = GHC.Types.TyCon - 0## 0## T8958.$trModule (GHC.Types.TrNameS "Map"#) + 11173210732975605893## + 6338753504925142034## + T8958.$trModule + (GHC.Types.TrNameS "Map"#) T8958.$tc'MkMap = GHC.Types.TyCon - 0## 0## T8958.$trModule (GHC.Types.TrNameS "'MkMap"#) + 10702411725744601909## + 8660532495248702786## + T8958.$trModule + (GHC.Types.TrNameS "'MkMap"#) T8958.$tcRepresentational = GHC.Types.TyCon - 0## 0## T8958.$trModule (GHC.Types.TrNameS "Representational"#) -T8958.$tc'D:Representational + 17939208465687456137## + 86959701938445380## + T8958.$trModule + (GHC.Types.TrNameS "Representational"#) +T8958.$tc'C:Representational = GHC.Types.TyCon - 0## 0## T8958.$trModule (GHC.Types.TrNameS "'D:Representational"#) + 6623579006299218188## + 18041743345929230411## + T8958.$trModule + (GHC.Types.TrNameS "'C:Representational"#) T8958.$tcNominal = GHC.Types.TyCon - 0## 0## T8958.$trModule (GHC.Types.TrNameS "Nominal"#) -T8958.$tc'D:Nominal + 5048799062136959048## + 4899664595355811926## + T8958.$trModule + (GHC.Types.TrNameS "Nominal"#) +T8958.$tc'C:Nominal = GHC.Types.TyCon - 0## 0## T8958.$trModule (GHC.Types.TrNameS "'D:Nominal"#) + 13167926310643805202## + 1726092271306256063## + T8958.$trModule + (GHC.Types.TrNameS "'C:Nominal"#) T8958.$trModule = GHC.Types.Module (GHC.Types.TrNameS "main"#) (GHC.Types.TrNameS "T8958"#) @@ -49,7 +67,7 @@ AbsBinds [a] [] Exported types: T8958.$fRepresentationala :: forall a. Representational a [LclIdX[DFunId], Str=DmdType] - Binds: $dRepresentational = T8958.D:Representational + Binds: $dRepresentational = T8958.C:Representational Evidence: [EvBinds{}]} AbsBinds [a] [] {Exports: [T8958.$fNominala <= $dNominal @@ -57,5 +75,6 @@ AbsBinds [a] [] <>] Exported types: T8958.$fNominala :: forall a. Nominal a [LclIdX[DFunId], Str=DmdType] - Binds: $dNominal = T8958.D:Nominal + Binds: $dNominal = T8958.C:Nominal Evidence: [EvBinds{}]} + diff --git a/testsuite/tests/simplCore/should_compile/T3717.stderr b/testsuite/tests/simplCore/should_compile/T3717.stderr index cdfc5f5069..b66f49fa83 100644 --- a/testsuite/tests/simplCore/should_compile/T3717.stderr +++ b/testsuite/tests/simplCore/should_compile/T3717.stderr @@ -22,7 +22,7 @@ T3717.$trModule1 = GHC.Types.TrNameS "T3717"# -- RHS size: {terms: 3, types: 0, coercions: 0} T3717.$trModule :: GHC.Types.Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout index 679d1eb2f6..aab671620c 100644 --- a/testsuite/tests/simplCore/should_compile/T3772.stdout +++ b/testsuite/tests/simplCore/should_compile/T3772.stdout @@ -47,7 +47,7 @@ T3772.$trModule2 = GHC.Types.TrNameS "main"# -- RHS size: {terms: 3, types: 0, coercions: 0} T3772.$trModule :: GHC.Types.Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T4201.stdout b/testsuite/tests/simplCore/should_compile/T4201.stdout index 51b159627e..384c62aa4c 100644 --- a/testsuite/tests/simplCore/should_compile/T4201.stdout +++ b/testsuite/tests/simplCore/should_compile/T4201.stdout @@ -1,3 +1,3 @@ {- Arity: 1, HasNoCafRefs, Strictness: <S,1*U()>m, Unfolding: InlineRule (0, True, True) - bof `cast` (Sym (NTCo:Foo[0]) ->_R <T>_R) -} + bof `cast` (Sym (N:Foo[0]) ->_R <T>_R) -} diff --git a/testsuite/tests/simplCore/should_compile/T4908.stderr b/testsuite/tests/simplCore/should_compile/T4908.stderr index bb0b08f53e..232e8c8ae8 100644 --- a/testsuite/tests/simplCore/should_compile/T4908.stderr +++ b/testsuite/tests/simplCore/should_compile/T4908.stderr @@ -22,7 +22,7 @@ T4908.$trModule1 = GHC.Types.TrNameS "T4908"# -- RHS size: {terms: 3, types: 0, coercions: 0} T4908.$trModule :: Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr index d7d97d5ab0..5d1daffc0f 100644 --- a/testsuite/tests/simplCore/should_compile/T4930.stderr +++ b/testsuite/tests/simplCore/should_compile/T4930.stderr @@ -22,7 +22,7 @@ T4930.$trModule1 = GHC.Types.TrNameS "T4930"# -- RHS size: {terms: 3, types: 0, coercions: 0} T4930.$trModule :: GHC.Types.Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index ca398ec6dc..ac570df364 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -41,7 +41,7 @@ T7360.$trModule1 = GHC.Types.TrNameS "T7360"# -- RHS size: {terms: 3, types: 0, coercions: 0} T7360.$trModule :: GHC.Types.Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -60,7 +60,7 @@ T7360.$tc'Foo6 = GHC.Types.TrNameS "'Foo3"# -- RHS size: {terms: 5, types: 0, coercions: 0} T7360.$tc'Foo3 :: GHC.Types.TyCon -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -83,7 +83,7 @@ T7360.$tc'Foo5 = GHC.Types.TrNameS "'Foo2"# -- RHS size: {terms: 5, types: 0, coercions: 0} T7360.$tc'Foo2 :: GHC.Types.TyCon -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -106,7 +106,7 @@ T7360.$tc'Foo4 = GHC.Types.TrNameS "'Foo1"# -- RHS size: {terms: 5, types: 0, coercions: 0} T7360.$tc'Foo1 :: GHC.Types.TyCon -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, @@ -129,7 +129,7 @@ T7360.$tcFoo1 = GHC.Types.TrNameS "Foo"# -- RHS size: {terms: 5, types: 0, coercions: 0} T7360.$tcFoo :: GHC.Types.TyCon -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/simplCore/should_compile/T9400.stderr b/testsuite/tests/simplCore/should_compile/T9400.stderr index 8fdcf39711..996890ff94 100644 --- a/testsuite/tests/simplCore/should_compile/T9400.stderr +++ b/testsuite/tests/simplCore/should_compile/T9400.stderr @@ -14,7 +14,7 @@ a1 = GHC.Types.TrNameS "T9400"# -- RHS size: {terms: 3, types: 0, coercions: 0} T9400.$trModule :: Module -[GblId[ReflectionId], Caf=NoCafRefs, Str=DmdType] +[GblId, Caf=NoCafRefs, Str=DmdType] T9400.$trModule = GHC.Types.Module a a1 -- RHS size: {terms: 22, types: 15, coercions: 0} diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr index c19aef0555..41824247d7 100644 --- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr +++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr @@ -22,7 +22,7 @@ Roman.$trModule1 = GHC.Types.TrNameS "Roman"# -- RHS size: {terms: 3, types: 0, coercions: 0} Roman.$trModule :: GHC.Types.Module -[GblId[ReflectionId], +[GblId, Caf=NoCafRefs, Str=DmdType m, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, diff --git a/testsuite/tests/typecheck/should_compile/tc231.stderr b/testsuite/tests/typecheck/should_compile/tc231.stderr index 85ccc32954..8c35af42cb 100644 --- a/testsuite/tests/typecheck/should_compile/tc231.stderr +++ b/testsuite/tests/typecheck/should_compile/tc231.stderr @@ -1,8 +1,12 @@ TYPE SIGNATURES + Node :: forall s a chain. s -> a -> chain -> Q s a chain + Z :: forall a. a -> Z a foo :: forall s b chain. Zork s (Z [Char]) b => Q s (Z [Char]) chain -> ST s () + huh :: + forall s a b. Zork s a b => forall chain. Q s a chain -> ST s () s :: forall t t1. Q t (Z [Char]) t1 -> Q t (Z [Char]) t1 TYPE CONSTRUCTORS data Q s a chain = Node s a chain @@ -13,9 +17,9 @@ TYPE CONSTRUCTORS huh :: Q s a chain -> ST s () {-# MINIMAL huh #-} COERCION AXIOMS - axiom NTCo:Zork :: + axiom N:Zork :: Zork s a b = forall chain. Q s a chain -> ST s () -- Defined at tc231.hs:25:1 Dependent modules: [] Dependent packages: [base-4.9.0.0, ghc-prim-0.5.0.0, - integer-gmp-1.0.0.0] + integer-gmp-1.0.0.1] |