summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci/scripts
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2022-04-06 18:55:11 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-04-07 12:57:59 -0400
commit02279a9c37deb34556834f706dbedc09258df753 (patch)
tree49875226385590fc2e25c6db224890ad374cc785 /testsuite/tests/ghci/scripts
parent83363c8b04837ee871a304cf85207cf79b299fb0 (diff)
downloadhaskell-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/tests/ghci/scripts')
-rw-r--r--testsuite/tests/ghci/scripts/T12550.stdout2
-rw-r--r--testsuite/tests/ghci/scripts/T21294a.script5
-rw-r--r--testsuite/tests/ghci/scripts/T21294a.stdout6
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
-rw-r--r--testsuite/tests/ghci/scripts/ghci011.stdout6
5 files changed, 16 insertions, 4 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’