diff options
author | Sylvain Henry <hsyl20@gmail.com> | 2018-06-15 16:23:53 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-06-15 16:23:54 -0400 |
commit | fe770c211631e7b4c9b0b1e88ef9b6046c6585ef (patch) | |
tree | e6a061a92d8d0d71d40c699982ee471627d816e0 /testsuite/tests/th | |
parent | 42f3b53b5bc4674e41f16de08094821fe1aaec00 (diff) | |
download | haskell-fe770c211631e7b4c9b0b1e88ef9b6046c6585ef.tar.gz |
Built-in Natural literals in Core
Add support for built-in Natural literals in Core.
- Replace MachInt,MachWord, LitInteger, etc. with a single LitNumber
constructor with a LitNumType field
- Support built-in Natural literals
- Add desugar warning for negative literals
- Move Maybe(..) from GHC.Base to GHC.Maybe for module dependency
reasons
This patch introduces only a few rules for Natural literals (compared
to Integer's rules). Factorization of the built-in rules for numeric
literals will be done in another patch as this one is already big to
review.
Test Plan:
validate
test build with integer-simple
Reviewers: hvr, bgamari, goldfire, Bodigrim, simonmar
Reviewed By: bgamari
Subscribers: phadej, simonpj, RyanGlScott, carter, hsyl20, rwbarton,
thomie
GHC Trac Issues: #14170, #14465
Differential Revision: https://phabricator.haskell.org/D4212
Diffstat (limited to 'testsuite/tests/th')
-rw-r--r-- | testsuite/tests/th/ClosedFam1TH.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/th/T14060.stdout | 4 | ||||
-rw-r--r-- | testsuite/tests/th/T4135.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/th/T5037.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/T8953.stderr | 2 | ||||
-rw-r--r-- | testsuite/tests/th/TH_RichKinds2.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/th/TH_reifyDecl2.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/th/TH_repGuard.stderr | 4 |
8 files changed, 17 insertions, 17 deletions
diff --git a/testsuite/tests/th/ClosedFam1TH.stderr b/testsuite/tests/th/ClosedFam1TH.stderr index 8855da204f..8db375413a 100644 --- a/testsuite/tests/th/ClosedFam1TH.stderr +++ b/testsuite/tests/th/ClosedFam1TH.stderr @@ -1,6 +1,6 @@ -ClosedFam1TH.hs:7:3: Warning: +ClosedFam1TH.hs:7:3: warning: type family Foo_0 a_1 (b_2 :: k_3) where Foo_0 GHC.Types.Int GHC.Types.Bool = GHC.Types.Int - Foo_0 a_4 GHC.Base.Maybe = GHC.Types.Bool + Foo_0 a_4 GHC.Maybe.Maybe = GHC.Types.Bool Foo_0 b_5 (x_6 :: GHC.Types.Bool) = GHC.Types.Char diff --git a/testsuite/tests/th/T14060.stdout b/testsuite/tests/th/T14060.stdout index c7668cfa3b..01857c3015 100644 --- a/testsuite/tests/th/T14060.stdout +++ b/testsuite/tests/th/T14060.stdout @@ -3,8 +3,8 @@ newtype Main.Foo1 ('(:) 'GHC.Types.True ('(:) 'GHC.Types.False ('[] :: [GHC.Types.Bool]))))) newtype Main.Foo2 (a_0 :: *) - = Main.Foo2 (Data.Proxy.Proxy (Main.Wurble (GHC.Base.Maybe a_0) - ('GHC.Base.Nothing :: GHC.Base.Maybe a_0))) + = Main.Foo2 (Data.Proxy.Proxy (Main.Wurble (GHC.Maybe.Maybe a_0) + ('GHC.Maybe.Nothing :: GHC.Maybe.Maybe a_0))) newtype Main.Foo3 = Main.Foo3 (Data.Proxy.Proxy (Main.Foo3Fam2 GHC.Types.Int :: *)) newtype Main.Foo4 diff --git a/testsuite/tests/th/T4135.stderr b/testsuite/tests/th/T4135.stderr index c666082754..3a4c6084d4 100644 --- a/testsuite/tests/th/T4135.stderr +++ b/testsuite/tests/th/T4135.stderr @@ -1,2 +1,2 @@ -instance Bug.C (GHC.Base.Maybe a_0) - where type Bug.T (GHC.Base.Maybe a_0) = GHC.Types.Char +instance Bug.C (GHC.Maybe.Maybe a_0) + where type Bug.T (GHC.Maybe.Maybe a_0) = GHC.Types.Char diff --git a/testsuite/tests/th/T5037.stderr b/testsuite/tests/th/T5037.stderr index 944cfa5c8c..67d7e2e7c6 100644 --- a/testsuite/tests/th/T5037.stderr +++ b/testsuite/tests/th/T5037.stderr @@ -1,3 +1,3 @@ -f_0 :: GHC.Base.Maybe GHC.Types.Int -> GHC.Types.Int -f_0 (GHC.Base.Nothing) = 3 -f_0 (GHC.Base.Just x_1) = x +f_0 :: GHC.Maybe.Maybe GHC.Types.Int -> GHC.Types.Int +f_0 (GHC.Maybe.Nothing) = 3 +f_0 (GHC.Maybe.Just x_1) = x diff --git a/testsuite/tests/th/T8953.stderr b/testsuite/tests/th/T8953.stderr index c724a8ea26..3dad41244b 100644 --- a/testsuite/tests/th/T8953.stderr +++ b/testsuite/tests/th/T8953.stderr @@ -1,6 +1,6 @@ type family T8953.Poly (a_0 :: k_1) :: * type instance T8953.Poly (x_2 :: GHC.Types.Bool) = GHC.Types.Int -type instance T8953.Poly (x_3 :: GHC.Base.Maybe k_4) = GHC.Types.Double +type instance T8953.Poly (x_3 :: GHC.Maybe.Maybe k_4) = GHC.Types.Double type family T8953.Silly :: k_0 -> * type instance T8953.Silly = (Data.Proxy.Proxy :: * -> *) type instance T8953.Silly = (Data.Proxy.Proxy :: (* -> *) -> *) diff --git a/testsuite/tests/th/TH_RichKinds2.stderr b/testsuite/tests/th/TH_RichKinds2.stderr index 8970da8bdb..a0b29a15e3 100644 --- a/testsuite/tests/th/TH_RichKinds2.stderr +++ b/testsuite/tests/th/TH_RichKinds2.stderr @@ -1,8 +1,8 @@ TH_RichKinds2.hs:25:4: warning: - data SMaybe_0 :: (k_0 -> *) -> GHC.Base.Maybe k_0 -> * where - SNothing_2 :: SMaybe_0 s_3 'GHC.Base.Nothing - SJust_4 :: (s_5 a_6) -> SMaybe_0 s_5 ('GHC.Base.Just a_6) + data SMaybe_0 :: (k_0 -> *) -> GHC.Maybe.Maybe k_0 -> * where + SNothing_2 :: SMaybe_0 s_3 'GHC.Maybe.Nothing + SJust_4 :: (s_5 a_6) -> SMaybe_0 s_5 ('GHC.Maybe.Just a_6) type instance TH_RichKinds2.Map f_7 '[] = '[] type instance TH_RichKinds2.Map f_8 ('(GHC.Types.:) h_9 t_10) = '(GHC.Types.:) (f_8 h_9) diff --git a/testsuite/tests/th/TH_reifyDecl2.stderr b/testsuite/tests/th/TH_reifyDecl2.stderr index 64436f811e..2e7650bc23 100644 --- a/testsuite/tests/th/TH_reifyDecl2.stderr +++ b/testsuite/tests/th/TH_reifyDecl2.stderr @@ -1,2 +1,2 @@ -data GHC.Base.Maybe (a_0 :: *) - = GHC.Base.Nothing | GHC.Base.Just a_0 +data GHC.Maybe.Maybe (a_0 :: *) + = GHC.Maybe.Nothing | GHC.Maybe.Just a_0 diff --git a/testsuite/tests/th/TH_repGuard.stderr b/testsuite/tests/th/TH_repGuard.stderr index bbef7eed59..ce93ab937d 100644 --- a/testsuite/tests/th/TH_repGuard.stderr +++ b/testsuite/tests/th/TH_repGuard.stderr @@ -1,7 +1,7 @@ foo_0 :: GHC.Types.Int -> GHC.Types.Int foo_0 x_1 | x_1 GHC.Classes.== 5 = 6 foo_0 x_2 = 7 -bar_0 :: GHC.Base.Maybe GHC.Types.Int -> GHC.Types.Int -bar_0 x_1 | GHC.Base.Just y_2 <- x_1 +bar_0 :: GHC.Maybe.Maybe GHC.Types.Int -> GHC.Types.Int +bar_0 x_1 | GHC.Maybe.Just y_2 <- x_1 = y_2 bar_0 _ = 9 |