diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2018-10-03 13:24:11 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2018-10-04 15:37:58 +0100 |
commit | e9e664022af66778bcc08f66ce3ba3b012c77ea4 (patch) | |
tree | a3980731457490ad2612d3966a70dad93e438528 /testsuite/tests/roles | |
parent | bd7898537768f936d05c0c83eef1cd9b00933347 (diff) | |
download | haskell-e9e664022af66778bcc08f66ce3ba3b012c77ea4.tar.gz |
Better -ddump-types
The debug flag -ddump-types is supposed to show the type
of Ids, and the kinds of type constructors. It was doing
the former but not the latter -- instead it was using
showTyTying, which is actually less helpful when debugging.
This patch changes it to print the kind and roles of the thing.
I also made -ddump-types show pattern synonyms
Diffstat (limited to 'testsuite/tests/roles')
6 files changed, 28 insertions, 41 deletions
diff --git a/testsuite/tests/roles/should_compile/Roles1.stderr b/testsuite/tests/roles/should_compile/Roles1.stderr index 4eae0a4754..e11b454f99 100644 --- a/testsuite/tests/roles/should_compile/Roles1.stderr +++ b/testsuite/tests/roles/should_compile/Roles1.stderr @@ -8,17 +8,17 @@ TYPE SIGNATURES Roles1.K7 :: forall {k} (a :: k) b. b -> T7 a b TYPE CONSTRUCTORS type role T1 nominal - data T1 a = K1 a - data T2 a = K2 a - type role T3 phantom - data T3 (a :: k) = K3 + T1 :: * -> * + T2 :: * -> * + type role T3 nominal phantom + T3 :: forall k. k -> * type role T4 nominal nominal - data T4 (a :: * -> *) b = K4 (a b) - data T5 a = K5 a - type role T6 phantom - data T6 (a :: k) = K6 - type role T7 phantom representational - data T7 (a :: k) b = K7 b + T4 :: (* -> *) -> * -> * + T5 :: * -> * + type role T6 nominal phantom + T6 :: forall {k}. k -> * + type role T7 nominal phantom representational + T7 :: forall {k}. k -> * -> * COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index 86434f1ed1..57899142d9 100644 --- a/testsuite/tests/roles/should_compile/Roles14.stderr +++ b/testsuite/tests/roles/should_compile/Roles14.stderr @@ -2,9 +2,7 @@ TYPE SIGNATURES meth2 :: forall a. C2 a => a -> a TYPE CONSTRUCTORS type role C2 representational - class C2 a where - meth2 :: a -> a - {-# MINIMAL meth2 #-} + C2 :: * -> Constraint COERCION AXIOMS axiom Roles12.N:C2 :: C2 a = a -> a -- Defined at Roles14.hs:6:1 Dependent modules: [] diff --git a/testsuite/tests/roles/should_compile/Roles2.stderr b/testsuite/tests/roles/should_compile/Roles2.stderr index 244b32feb7..81cf221fbd 100644 --- a/testsuite/tests/roles/should_compile/Roles2.stderr +++ b/testsuite/tests/roles/should_compile/Roles2.stderr @@ -2,9 +2,9 @@ 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) + T1 :: * -> * type role T2 phantom - data T2 a = K2 (FunPtr a) + T2 :: * -> * COERCION AXIOMS Dependent modules: [] Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index aa2a07f459..ff36be8bdf 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -4,22 +4,15 @@ TYPE SIGNATURES 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 - {-# MINIMAL meth1 #-} - class C2 a b where - meth2 :: (a ~ b) => a -> b - {-# MINIMAL meth2 #-} - class C3 a b where - type family F3 b :: * open - meth3 :: a -> F3 b -> F3 b - {-# MINIMAL meth3 #-} - class C4 a b where - meth4 :: a -> F4 b -> F4 b - {-# MINIMAL meth4 #-} - type family F4 a :: * open - type Syn1 a = F4 a - type Syn2 a = [a] + C1 :: * -> Constraint + C2 :: * -> * -> Constraint + C3 :: * -> * -> Constraint + C4 :: * -> * -> Constraint + type role F4 nominal + F4 :: * -> * + type role Syn1 nominal + Syn1 :: * -> * + Syn2 :: * -> * COERCION AXIOMS axiom Roles3.N:C1 :: C1 a = a -> a -- Defined at Roles3.hs:6:1 axiom Roles3.N:C2 :: diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index 9f8803d11d..93a86a514c 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -2,13 +2,9 @@ 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 - {-# MINIMAL meth1 #-} - class C3 a where - meth3 :: a -> Syn1 a - {-# MINIMAL meth3 #-} - type Syn1 a = [a] + C1 :: * -> Constraint + C3 :: * -> Constraint + Syn1 :: * -> * COERCION AXIOMS axiom Roles4.N:C1 :: C1 a = a -> a -- Defined at Roles4.hs:6:1 axiom Roles4.N:C3 :: diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index db4e8330de..55a6303b64 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -5,10 +5,10 @@ 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)] - class Nominal a + Map :: * -> * -> * + Nominal :: * -> Constraint type role Representational representational - class Representational a + Representational :: * -> Constraint COERCION AXIOMS axiom T8958.N:Map :: Map k v = [(k, v)] -- Defined at T8958.hs:13:1 INSTANCES |