diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2022-04-06 18:55:11 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-07 12:57:59 -0400 |
commit | 02279a9c37deb34556834f706dbedc09258df753 (patch) | |
tree | 49875226385590fc2e25c6db224890ad374cc785 /testsuite | |
parent | 83363c8b04837ee871a304cf85207cf79b299fb0 (diff) | |
download | haskell-02279a9c37deb34556834f706dbedc09258df753.tar.gz |
Rename [] to List (#21294)
This patch implements a small part of GHC Proposal #475.
The key change is in GHC.Types:
- data [] a = [] | a : [a]
+ data List a = [] | a : List a
And the rest of the patch makes sure that List is pretty-printed as []
in various contexts.
Updates the haddock submodule.
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/ghci/scripts/T12550.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T21294a.script | 5 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/T21294a.stdout | 6 | ||||
-rwxr-xr-x | testsuite/tests/ghci/scripts/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/ghci/scripts/ghci011.stdout | 6 | ||||
-rw-r--r-- | testsuite/tests/hiefile/should_run/HieQueries.stdout | 9 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/Roles4.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/roles/should_compile/T8958.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/showIface/DocsInHiFileTH.stdout | 6 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/T15445.stderr | 2 |
10 files changed, 27 insertions, 14 deletions
diff --git a/testsuite/tests/ghci/scripts/T12550.stdout b/testsuite/tests/ghci/scripts/T12550.stdout index d753d4f666..0a30edf362 100644 --- a/testsuite/tests/ghci/scripts/T12550.stdout +++ b/testsuite/tests/ghci/scripts/T12550.stdout @@ -28,9 +28,9 @@ instance ∀ a b. Functor ((,,) a b) -- Defined in ‘GHC.Base’ instance ∀ a b c. Functor ((,,,) a b c) -- Defined in ‘GHC.Base’ instance ∀ r. Functor ((->) r) -- Defined in ‘GHC.Base’ instance Functor IO -- Defined in ‘GHC.Base’ +instance Functor [] -- Defined in ‘GHC.Base’ instance Functor Maybe -- Defined in ‘GHC.Base’ instance Functor Solo -- Defined in ‘GHC.Base’ -instance Functor [] -- Defined in ‘GHC.Base’ instance ∀ a. Functor (Either a) -- Defined in ‘Data.Either’ instance ∀ (f ∷ ★ → ★) (g ∷ ★ → ★). (Functor f, Functor g) ⇒ diff --git a/testsuite/tests/ghci/scripts/T21294a.script b/testsuite/tests/ghci/scripts/T21294a.script new file mode 100644 index 0000000000..e4a91a5d83 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T21294a.script @@ -0,0 +1,5 @@ +type L0 = [] +:i L0 + +type L1 a = [a] +:i L1 diff --git a/testsuite/tests/ghci/scripts/T21294a.stdout b/testsuite/tests/ghci/scripts/T21294a.stdout new file mode 100644 index 0000000000..58fb4e6c27 --- /dev/null +++ b/testsuite/tests/ghci/scripts/T21294a.stdout @@ -0,0 +1,6 @@ +type L0 :: * -> * +type L0 = [] :: * -> * + -- Defined at <interactive>:1:1 +type L1 :: * -> * +type L1 a = [a] + -- Defined at <interactive>:4:1 diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T index f2d03bd8cf..9e7ca144a6 100755 --- a/testsuite/tests/ghci/scripts/all.T +++ b/testsuite/tests/ghci/scripts/all.T @@ -367,3 +367,4 @@ test('T21088', normal, ghci_script, ['T21088.script']) test('T21110', [extra_files(['T21110A.hs'])], ghci_script, ['T21110.script']) test('T17830', [filter_stdout_lines(r'======.*')], ghci_script, ['T17830.script']) +test('T21294a', normal, ghci_script, ['T21294a.script']) diff --git a/testsuite/tests/ghci/scripts/ghci011.stdout b/testsuite/tests/ghci/scripts/ghci011.stdout index d03977e3b5..edb6158456 100644 --- a/testsuite/tests/ghci/scripts/ghci011.stdout +++ b/testsuite/tests/ghci/scripts/ghci011.stdout @@ -1,5 +1,5 @@ -type [] :: * -> * -data [] a = [] | a : [a] +type List :: * -> * +data List a = [] | a : [a] -- Defined in ‘GHC.Types’ instance Monoid [a] -- Defined in ‘GHC.Base’ instance Semigroup [a] -- Defined in ‘GHC.Base’ @@ -35,9 +35,9 @@ instance (Semigroup a, Semigroup b) => Semigroup (a, b) instance Foldable ((,) a) -- Defined in ‘Data.Foldable’ instance (Bounded a, Bounded b) => Bounded (a, b) -- Defined in ‘GHC.Enum’ -instance (Read a, Read b) => Read (a, b) -- Defined in ‘GHC.Read’ instance (Eq a, Eq b) => Eq (a, b) -- Defined in ‘GHC.Classes’ instance (Ord a, Ord b) => Ord (a, b) -- Defined in ‘GHC.Classes’ +instance (Read a, Read b) => Read (a, b) -- Defined in ‘GHC.Read’ instance (Show a, Show b) => Show (a, b) -- Defined in ‘GHC.Show’ instance Monoid a => Applicative ((,) a) -- Defined in ‘GHC.Base’ instance Functor ((,) a) -- Defined in ‘GHC.Base’ diff --git a/testsuite/tests/hiefile/should_run/HieQueries.stdout b/testsuite/tests/hiefile/should_run/HieQueries.stdout index 98f0466815..d352cc9c38 100644 --- a/testsuite/tests/hiefile/should_run/HieQueries.stdout +++ b/testsuite/tests/hiefile/should_run/HieQueries.stdout @@ -3,14 +3,15 @@ At point (31,9), we found: ========================== ┌ │ $dC at HieQueries.hs:31:1-13, of type: C [a] -│ is an evidence variable bound by a let, depending on: [$fC[], $dC] +│ is an evidence variable bound by a let, depending on: [$fCList, +│ $dC] │ with scope: LocalScope HieQueries.hs:31:1-13 │ bound at: HieQueries.hs:31:1-13 │ Defined at <no location info> └ | +- ┌ -| │ $fC[] at HieQueries.hs:27:10-21, of type: forall a. C a => C [a] +| │ $fCList at HieQueries.hs:27:10-21, of type: forall a. C a => C [a] | │ is an evidence variable bound by an instance of class C | │ with scope: ModuleScope | │ @@ -30,7 +31,7 @@ At point (37,9), we found: ========================== ┌ │ $dShow at HieQueries.hs:37:1-22, of type: Show [(Integer, x, A)] -│ is an evidence variable bound by a let, depending on: [$fShow[], +│ is an evidence variable bound by a let, depending on: [$fShowList, │ $dShow] │ with scope: LocalScope HieQueries.hs:37:1-22 │ bound at: HieQueries.hs:37:1-22 @@ -38,7 +39,7 @@ At point (37,9), we found: └ | +- ┌ -| │ $fShow[] at HieQueries.hs:37:1-22, of type: forall a. Show a => Show [a] +| │ $fShowList at HieQueries.hs:37:1-22, of type: forall a. Show a => Show [a] | │ is a usage of an external evidence variable | │ Defined in `GHC.Show' | └ diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index 4d8bc6666a..d4efc75d76 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -35,7 +35,7 @@ $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] - = GHC.Types.KindRepTyConApp GHC.Types.$tc[] ((:) $krep []) + = GHC.Types.KindRepTyConApp GHC.Types.$tcList ((:) $krep []) $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] $krep [InlPrag=[~]] diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index 6a6e3dc627..b06d0df7f8 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -59,7 +59,7 @@ $krep [InlPrag=[~]] $krep ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep)) $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp - GHC.Types.$tc[] + GHC.Types.$tcList ((:) @GHC.Types.KindRep $krep [] @GHC.Types.KindRep) $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp diff --git a/testsuite/tests/showIface/DocsInHiFileTH.stdout b/testsuite/tests/showIface/DocsInHiFileTH.stdout index 0e9c1af6d5..1eac242a68 100644 --- a/testsuite/tests/showIface/DocsInHiFileTH.stdout +++ b/testsuite/tests/showIface/DocsInHiFileTH.stdout @@ -106,9 +106,9 @@ docs: $fCTYPEInt -> [text: -- |A new instance identifiers:], - $fCTYPE[] -> [text: - -- |Another new instance - identifiers:], + $fCTYPEList -> [text: + -- |Another new instance + identifiers:], $fDka -> [text: -- |Another new instance identifiers:], diff --git a/testsuite/tests/simplCore/should_compile/T15445.stderr b/testsuite/tests/simplCore/should_compile/T15445.stderr index 5e8a086e6d..b67e385a98 100644 --- a/testsuite/tests/simplCore/should_compile/T15445.stderr +++ b/testsuite/tests/simplCore/should_compile/T15445.stderr @@ -2,7 +2,7 @@ Rule fired: Class op + (BUILTIN) Rule fired: Class op fromInteger (BUILTIN) Rule fired: Int# -> Integer -> Int# (GHC.Num.Integer) Rule fired: SPEC plusTwoRec (T15445a) -Rule fired: SPEC $fShow[] (GHC.Show) +Rule fired: SPEC $fShowList (GHC.Show) Rule fired: Class op >> (BUILTIN) Rule fired: Class op show (BUILTIN) Rule fired: SPEC plusTwoRec (T15445a) |