diff options
29 files changed, 251 insertions, 247 deletions
diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs index e2e51d8c58..9426a30d95 100644 --- a/compiler/iface/IfaceType.hs +++ b/compiler/iface/IfaceType.hs @@ -342,8 +342,23 @@ isIfaceLiftedTypeKind _ = False splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType) -- Mainly for printing purposes +-- +-- Here we split nested IfaceSigmaTy properly. +-- +-- @ +-- forall t. T t => forall m a b. M m => (a -> m b) -> t a -> m (t b) +-- @ +-- +-- If you called @splitIfaceSigmaTy@ on this type: +-- +-- @ +-- ([t, m, a, b], [T t, M m], (a -> m b) -> t a -> m (t b)) +-- @ splitIfaceSigmaTy ty - = (bndrs, theta, tau) + = case (bndrs, theta) of + ([], []) -> (bndrs, theta, tau) + _ -> let (bndrs', theta', tau') = splitIfaceSigmaTy tau + in (bndrs ++ bndrs', theta ++ theta', tau') where (bndrs, rho) = split_foralls ty (theta, tau) = split_rho rho @@ -623,6 +638,8 @@ pprIfaceType = pprPrecIfaceType topPrec pprParendIfaceType = pprPrecIfaceType appPrec pprPrecIfaceType :: PprPrec -> IfaceType -> SDoc +-- We still need `eliminateRuntimeRep`, since the `pprPrecIfaceType` maybe +-- called from other places, besides `:type` and `:info`. pprPrecIfaceType prec ty = eliminateRuntimeRep (ppr_ty prec) ty ppr_ty :: PprPrec -> IfaceType -> SDoc @@ -883,9 +900,11 @@ data ShowForAllFlag = ShowForAllMust | ShowForAllWhen pprIfaceSigmaType :: ShowForAllFlag -> IfaceType -> SDoc pprIfaceSigmaType show_forall ty - = ppr_iface_forall_part show_forall tvs theta (ppr tau) + = eliminateRuntimeRep ppr_fn ty where - (tvs, theta, tau) = splitIfaceSigmaTy ty + ppr_fn iface_ty = + let (tvs, theta, tau) = splitIfaceSigmaTy iface_ty + in ppr_iface_forall_part show_forall tvs theta (ppr tau) pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc pprUserIfaceForAll tvs diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 98786e60b6..e25f5ab039 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -9407,7 +9407,7 @@ stub out functions that return unboxed types. Printing levity-polymorphic types --------------------------------- -.. ghc-flag:: -fprint-explicit-runtime-rep +.. ghc-flag:: -fprint-explicit-runtime-reps :shortdesc: Print ``RuntimeRep`` variables in types which are runtime-representation polymorphic. :type: dynamic diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py index 6e86cdc0b8..0f988ca21b 100644 --- a/testsuite/driver/testlib.py +++ b/testsuite/driver/testlib.py @@ -1440,7 +1440,7 @@ def stdout_ok(name, way): expected_stdout_file, actual_stdout_file) def dump_stdout( name ): - with open(in_testdir(name, 'run.stdout')) as f: + with open(in_testdir(name, 'run.stdout'), encoding='utf8') as f: str = f.read().strip() if str: print("Stdout (", name, "):") @@ -1456,7 +1456,7 @@ def stderr_ok(name, way): whitespace_normaliser=normalise_whitespace) def dump_stderr( name ): - with open(in_testdir(name, 'run.stderr')) as f: + with open(in_testdir(name, 'run.stderr'), encoding='utf8') as f: str = f.read().strip() if str: print("Stderr (", name, "):") diff --git a/testsuite/tests/dependent/ghci/T11549.script b/testsuite/tests/dependent/ghci/T11549.script index bb35589671..d8a0e97a61 100644 --- a/testsuite/tests/dependent/ghci/T11549.script +++ b/testsuite/tests/dependent/ghci/T11549.script @@ -3,12 +3,16 @@ import GHC.Exts putStrLn "-fno-print-explicit-runtime-reps" :set -fno-print-explicit-runtime-reps +:type ($) :info ($) :kind TYPE +:type error :info error putStrLn "\n-fprint-explicit-runtime-reps" :set -fprint-explicit-runtime-reps +:type ($) :info ($) :kind TYPE +:type error :info error diff --git a/testsuite/tests/dependent/ghci/T11549.stdout b/testsuite/tests/dependent/ghci/T11549.stdout index c8449ba09f..5e23c0da99 100644 --- a/testsuite/tests/dependent/ghci/T11549.stdout +++ b/testsuite/tests/dependent/ghci/T11549.stdout @@ -1,12 +1,21 @@ -fno-print-explicit-runtime-reps ($) :: (a -> b) -> a -> b +($) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’ +infixr 0 $ TYPE :: RuntimeRep -> * +error :: [Char] -> a error :: GHC.Stack.Types.HasCallStack => [Char] -> a + -- Defined in ‘GHC.Err’ -fprint-explicit-runtime-reps +($) :: (a -> b) -> a -> b ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b + -- Defined in ‘GHC.Base’ +infixr 0 $ TYPE :: RuntimeRep -> * -error - :: forall (r :: RuntimeRep) (a :: TYPE r). - GHC.Stack.Types.HasCallStack => - [Char] -> a +error :: [Char] -> a +error :: + forall (r :: RuntimeRep) (a :: TYPE r). + GHC.Stack.Types.HasCallStack => + [Char] -> a + -- Defined in ‘GHC.Err’ diff --git a/testsuite/tests/dependent/ghci/T11786.script b/testsuite/tests/dependent/ghci/T11786.script new file mode 100644 index 0000000000..61e3141843 --- /dev/null +++ b/testsuite/tests/dependent/ghci/T11786.script @@ -0,0 +1,11 @@ +:set -fno-print-explicit-runtime-reps +:t ($) +:t (($)) +:t +v ($) +:i ($) + +:set -fprint-explicit-runtime-reps +:t ($) +:t (($)) +:t +v ($) +:i ($) diff --git a/testsuite/tests/dependent/ghci/T11786.stdout b/testsuite/tests/dependent/ghci/T11786.stdout new file mode 100644 index 0000000000..93616ed750 --- /dev/null +++ b/testsuite/tests/dependent/ghci/T11786.stdout @@ -0,0 +1,15 @@ +($) :: (a -> b) -> a -> b +(($)) :: (a -> b) -> a -> b +($) :: (a -> b) -> a -> b +($) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’ +infixr 0 $ +($) :: (a -> b) -> a -> b +(($)) :: (a -> b) -> a -> b +($) + :: forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r). + (a -> b) -> a -> b +($) :: + forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r). + (a -> b) -> a -> b + -- Defined in ‘GHC.Base’ +infixr 0 $ diff --git a/testsuite/tests/dependent/ghci/all.T b/testsuite/tests/dependent/ghci/all.T index bd819c28bc..89ebab0e44 100644 --- a/testsuite/tests/dependent/ghci/all.T +++ b/testsuite/tests/dependent/ghci/all.T @@ -1,5 +1,3 @@ -test('T11549', - [ expect_broken( 11787 ), - expect_broken( 11786 ) ], - ghci_script, ['T11549.script']) +test('T11549', normal, ghci_script, ['T11549.script']) +test('T11786', normal, ghci_script, ['T11786.script']) test('T14238', normal, ghci_script, ['T14238.script']) diff --git a/testsuite/tests/ghci/scripts/T11975.stdout b/testsuite/tests/ghci/scripts/T11975.stdout index 464ae2e815..56d8d4180d 100644 --- a/testsuite/tests/ghci/scripts/T11975.stdout +++ b/testsuite/tests/ghci/scripts/T11975.stdout @@ -3,13 +3,13 @@ mapM (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM - :: forall (t :: * -> *). - Traversable t => - forall (m :: * -> *) a b. Monad m => (a -> m b) -> t a -> m (t b) + :: forall (t :: * -> *) (m :: * -> *) a b. + (Traversable t, Monad m) => + (a -> m b) -> t a -> m (t b) mapM - :: forall (t :: * -> *). - Traversable t => - forall (m :: * -> *) a b. Monad m => (a -> m b) -> t a -> m (t b) + :: forall (t :: * -> *) (m :: * -> *) a b. + (Traversable t, Monad m) => + (a -> m b) -> t a -> m (t b) foo @Int :: forall {b}. Num b => Int -> b foo @Int :: forall b. (Show Int, Num b) => Int -> b foo @Int :: forall b. (Show Int, Num b) => Int -> b diff --git a/testsuite/tests/ghci/scripts/T13963.script b/testsuite/tests/ghci/scripts/T13963.script index 630e5cd70c..fdd4d78338 100644 --- a/testsuite/tests/ghci/scripts/T13963.script +++ b/testsuite/tests/ghci/scripts/T13963.script @@ -6,4 +6,8 @@ type Pair (a :: TYPE rep) (b :: TYPE rep') rep'' = forall (r :: TYPE rep''). (a :kind Pair Int Float :kind Pair Int Float LiftedRep - +:set -fprint-explicit-runtime-reps +:kind Pair +:kind Pair Int +:kind Pair Int Float +:kind Pair Int Float LiftedRep diff --git a/testsuite/tests/ghci/scripts/T13963.stdout b/testsuite/tests/ghci/scripts/T13963.stdout index 9e31d8bebc..52026af489 100644 --- a/testsuite/tests/ghci/scripts/T13963.stdout +++ b/testsuite/tests/ghci/scripts/T13963.stdout @@ -1,3 +1,7 @@ +Pair :: * -> * -> RuntimeRep -> * +Pair Int :: * -> RuntimeRep -> * +Pair Int Float :: RuntimeRep -> * +Pair Int Float LiftedRep :: * Pair :: TYPE rep -> TYPE rep' -> RuntimeRep -> * Pair Int :: * -> RuntimeRep -> * Pair Int Float :: RuntimeRep -> * diff --git a/testsuite/tests/ghci/scripts/T5545.stdout b/testsuite/tests/ghci/scripts/T5545.stdout index 9780ffc4ad..2262c35739 100644 --- a/testsuite/tests/ghci/scripts/T5545.stdout +++ b/testsuite/tests/ghci/scripts/T5545.stdout @@ -1,5 +1,2 @@ -($!) :: - forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r). - (a -> b) -> a -> b - -- Defined in ‘GHC.Base’ +($!) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’ infixr 0 $! diff --git a/testsuite/tests/ghci/scripts/ghci025.stdout b/testsuite/tests/ghci/scripts/ghci025.stdout index d660d233cd..e5638b07e9 100644 --- a/testsuite/tests/ghci/scripts/ghci025.stdout +++ b/testsuite/tests/ghci/scripts/ghci025.stdout @@ -8,18 +8,18 @@ class C a b ... c1 :: (C a b, N b) => a -> b c2 :: (C a b, N b, S b) => a -> b -c3 :: C a b => forall a. a -> b -c4 :: C a b => forall a1. a1 -> b +c3 :: C a b => a -> b +c4 :: C a b => a1 -> b -- imported via Control.Monad class (GHC.Base.Alternative m, Monad m) => MonadPlus (m :: * -> *) ... -mplus :: MonadPlus m => forall a. m a -> m a -> m a -mzero :: MonadPlus m => forall a. m a +mplus :: MonadPlus m => m a -> m a -> m a +mzero :: MonadPlus m => m a -- imported via Control.Monad, Prelude -(>>) :: Monad m => forall a b. m a -> m b -> m b -(>>=) :: Monad m => forall a b. m a -> (a -> m b) -> m b -fail :: Monad m => forall a. GHC.Base.String -> m a -return :: Monad m => forall a. a -> m a +(>>) :: Monad m => m a -> m b -> m b +(>>=) :: Monad m => m a -> (a -> m b) -> m b +fail :: Monad m => GHC.Base.String -> m a +return :: Monad m => a -> m a -- imported via Control.Monad, Prelude, T class GHC.Base.Applicative m => Monad (m :: * -> *) ... @@ -43,8 +43,7 @@ Nothing :: Maybe a class Eq a ... -- imported via Prelude, T -Prelude.length :: - Data.Foldable.Foldable t => forall a. t a -> GHC.Types.Int +Prelude.length :: Data.Foldable.Foldable t => t a -> GHC.Types.Int -- imported via T data T.Integer = ... T.length :: Data.ByteString.Internal.ByteString -> GHC.Types.Int @@ -57,8 +56,8 @@ class C a b ... c1 :: (C a b, N b) => a -> b c2 :: (C a b, N b, S b) => a -> b -c3 :: C a b => forall a. a -> b -c4 :: C a b => forall a1. a1 -> b +c3 :: C a b => a -> b +c4 :: C a b => a1 -> b :browse! T -- with -fprint-explicit-foralls -- defined locally T.length :: T.Integer @@ -68,8 +67,8 @@ class C a b ... c1 :: forall a b. (C a b, N b) => a -> b c2 :: forall a b. (C a b, N b, S b) => a -> b -c3 :: forall a b. C a b => forall a. a -> b -c4 :: forall a b. C a b => forall a1. a1 -> b +c3 :: forall a b a. C a b => a -> b +c4 :: forall a b a1. C a b => a1 -> b -- test :browse! <target> relative to different contexts :browse! Ghci025C -- from *Ghci025C> -- defined locally @@ -94,4 +93,3 @@ Ghci025C.g :: forall {a}. Num a => a -> a Ghci025C.h :: forall {a}. Integral a => a -> a -- defined locally f :: forall {a}. Num a => a -> a - diff --git a/testsuite/tests/typecheck/should_compile/T13050.stderr b/testsuite/tests/typecheck/should_compile/T13050.stderr index 407b256d81..36e22ae3f8 100644 --- a/testsuite/tests/typecheck/should_compile/T13050.stderr +++ b/testsuite/tests/typecheck/should_compile/T13050.stderr @@ -76,11 +76,11 @@ T13050.hs:4:9: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Base’)) @@ -162,11 +162,11 @@ T13050.hs:5:11: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Base’)) @@ -249,11 +249,11 @@ T13050.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T13050.hs:1:8-17 (and originally defined in ‘GHC.Base’)) diff --git a/testsuite/tests/typecheck/should_compile/T14590.stderr b/testsuite/tests/typecheck/should_compile/T14590.stderr index 2e0f784e02..455898be1a 100644 --- a/testsuite/tests/typecheck/should_compile/T14590.stderr +++ b/testsuite/tests/typecheck/should_compile/T14590.stderr @@ -77,11 +77,11 @@ T14590.hs:4:13: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) @@ -165,11 +165,11 @@ T14590.hs:5:13: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) @@ -252,11 +252,11 @@ T14590.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) @@ -340,11 +340,11 @@ T14590.hs:7:11: warning: [-Wtyped-holes (in -Wdefault)] with min @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Classes’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Int) @Int (imported from ‘Prelude’ at T14590.hs:1:8-13 (and originally defined in ‘GHC.Base’)) diff --git a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr index 3c2a30563a..c5627f9769 100644 --- a/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/abstract_refinement_hole_fits.stderr @@ -11,49 +11,37 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] g :: [Integer] -> Integer head :: forall a. [a] -> a last :: forall a. [a] -> a - maximum :: forall (t :: * -> *). - Foldable t => - forall a. Ord a => t a -> a - minimum :: forall (t :: * -> *). - Foldable t => - forall a. Ord a => t a -> a - product :: forall (t :: * -> *). - Foldable t => - forall a. Num a => t a -> a - sum :: forall (t :: * -> *). - Foldable t => - forall a. Num a => t a -> a + maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a + minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a + product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a + sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a Valid refinement hole fits include foldl1 (_ :: Integer -> Integer -> Integer) - where foldl1 :: forall (t :: * -> *). + where foldl1 :: forall (t :: * -> *) a. Foldable t => - forall a. (a -> a -> a) -> t a -> a + (a -> a -> a) -> t a -> a foldr1 (_ :: Integer -> Integer -> Integer) - where foldr1 :: forall (t :: * -> *). + where foldr1 :: forall (t :: * -> *) a. Foldable t => - forall a. (a -> a -> a) -> t a -> a + (a -> a -> a) -> t a -> a foldl (_ :: Integer -> Integer -> Integer) (_ :: Integer) - where foldl :: forall (t :: * -> *). + where foldl :: forall (t :: * -> *) b a. Foldable t => - forall b a. (b -> a -> b) -> b -> t a -> b + (b -> a -> b) -> b -> t a -> b foldr (_ :: Integer -> Integer -> Integer) (_ :: Integer) - where foldr :: forall (t :: * -> *). + where foldr :: forall (t :: * -> *) a b. Foldable t => - forall a b. (a -> b -> b) -> b -> t a -> b + (a -> b -> b) -> b -> t a -> b const (_ :: Integer) where const :: forall a b. a -> b -> a ($) (_ :: [Integer] -> Integer) where ($) :: forall a b. (a -> b) -> a -> b fail (_ :: String) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a return (_ :: Integer) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: Integer) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a ($!) (_ :: [Integer] -> Integer) where ($!) :: forall a b. (a -> b) -> a -> b curry (_ :: (a2, [Integer]) -> Integer) (_ :: a2) @@ -63,25 +51,25 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] flip (_ :: [Integer] -> b7 -> Integer) (_ :: b7) where flip :: forall a b c. (a -> b -> c) -> b -> a -> c (>>=) (_ :: [Integer] -> a11) (_ :: a11 -> [Integer] -> Integer) - where (>>=) :: forall (m :: * -> *). + where (>>=) :: forall (m :: * -> *) a b. Monad m => - forall a b. m a -> (a -> m b) -> m b + m a -> (a -> m b) -> m b (>>) (_ :: [Integer] -> a10) (_ :: [Integer] -> Integer) - where (>>) :: forall (m :: * -> *). + where (>>) :: forall (m :: * -> *) a b. Monad m => - forall a b. m a -> m b -> m b + m a -> m b -> m b fmap (_ :: a12 -> Integer) (_ :: [Integer] -> a12) - where fmap :: forall (f :: * -> *). + where fmap :: forall (f :: * -> *) a b. Functor f => - forall a b. (a -> b) -> f a -> f b + (a -> b) -> f a -> f b (<*>) (_ :: [Integer] -> a8 -> Integer) (_ :: [Integer] -> a8) - where (<*>) :: forall (f :: * -> *). + where (<*>) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f (a -> b) -> f a -> f b + f (a -> b) -> f a -> f b (*>) (_ :: [Integer] -> a7) (_ :: [Integer] -> Integer) - where (*>) :: forall (f :: * -> *). + where (*>) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f a -> f b -> f b + f a -> f b -> f b (<$>) (_ :: a1 -> Integer) (_ :: [Integer] -> a1) where (<$>) :: forall (f :: * -> *) a b. Functor f => @@ -91,13 +79,13 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] Monad m => (a -> m b) -> m a -> m b (<*) (_ :: [Integer] -> Integer) (_ :: [Integer] -> b5) - where (<*) :: forall (f :: * -> *). + where (<*) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f a -> f b -> f a + f a -> f b -> f a (<$) (_ :: Integer) (_ :: [Integer] -> b4) - where (<$) :: forall (f :: * -> *). + where (<$) :: forall (f :: * -> *) a b. Functor f => - forall a b. a -> f b -> f a + a -> f b -> f a id (_ :: t0 -> [Integer] -> Integer) (_ :: t0) where id :: forall a. a -> a head (_ :: [t0 -> [Integer] -> Integer]) (_ :: t0) @@ -129,15 +117,11 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] ($) (_ :: a5 -> [Integer] -> Integer) (_ :: a5) where ($) :: forall a b. (a -> b) -> a -> b fail (_ :: String) (_ :: t0) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a return (_ :: [Integer] -> Integer) (_ :: t0) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: [Integer] -> Integer) (_ :: t0) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a uncurry (_ :: a4 -> b3 -> [Integer] -> Integer) (_ :: (a4, b3)) where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c ($!) (_ :: a6 -> [Integer] -> Integer) (_ :: a6) @@ -153,17 +137,17 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] (bound at abstract_refinement_hole_fits.hs:7:1) Valid hole fits include const :: forall a b. a -> b -> a - return :: forall (m :: * -> *). Monad m => forall a. a -> m a - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + return :: forall (m :: * -> *) a. Monad m => a -> m a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a Valid refinement hole fits include foldl (_ :: Integer -> Integer -> Integer) - where foldl :: forall (t :: * -> *). + where foldl :: forall (t :: * -> *) b a. Foldable t => - forall b a. (b -> a -> b) -> b -> t a -> b + (b -> a -> b) -> b -> t a -> b foldr (_ :: Integer -> Integer -> Integer) - where foldr :: forall (t :: * -> *). + where foldr :: forall (t :: * -> *) a b. Foldable t => - forall a b. (a -> b -> b) -> b -> t a -> b + (a -> b -> b) -> b -> t a -> b curry (_ :: (Integer, [Integer]) -> Integer) where curry :: forall a b c. ((a, b) -> c) -> a -> b -> c flip (_ :: [Integer] -> Integer -> Integer) @@ -173,15 +157,11 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] ($) (_ :: Integer -> [Integer] -> Integer) where ($) :: forall a b. (a -> b) -> a -> b fail (_ :: String) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a return (_ :: [Integer] -> Integer) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: [Integer] -> Integer) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a ($!) (_ :: Integer -> [Integer] -> Integer) where ($!) :: forall a b. (a -> b) -> a -> b curry (_ :: (a2, Integer) -> [Integer] -> Integer) (_ :: a2) @@ -192,26 +172,26 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] where flip :: forall a b c. (a -> b -> c) -> b -> a -> c (>>=) (_ :: Integer -> a11) (_ :: a11 -> Integer -> [Integer] -> Integer) - where (>>=) :: forall (m :: * -> *). + where (>>=) :: forall (m :: * -> *) a b. Monad m => - forall a b. m a -> (a -> m b) -> m b + m a -> (a -> m b) -> m b (>>) (_ :: Integer -> a10) (_ :: Integer -> [Integer] -> Integer) - where (>>) :: forall (m :: * -> *). + where (>>) :: forall (m :: * -> *) a b. Monad m => - forall a b. m a -> m b -> m b + m a -> m b -> m b fmap (_ :: a12 -> [Integer] -> Integer) (_ :: Integer -> a12) - where fmap :: forall (f :: * -> *). + where fmap :: forall (f :: * -> *) a b. Functor f => - forall a b. (a -> b) -> f a -> f b + (a -> b) -> f a -> f b (<*>) (_ :: Integer -> a8 -> [Integer] -> Integer) (_ :: Integer -> a8) - where (<*>) :: forall (f :: * -> *). + where (<*>) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f (a -> b) -> f a -> f b + f (a -> b) -> f a -> f b (*>) (_ :: Integer -> a7) (_ :: Integer -> [Integer] -> Integer) - where (*>) :: forall (f :: * -> *). + where (*>) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f a -> f b -> f b + f a -> f b -> f b (<$>) (_ :: a1 -> [Integer] -> Integer) (_ :: Integer -> a1) where (<$>) :: forall (f :: * -> *) a b. Functor f => @@ -222,13 +202,13 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] Monad m => (a -> m b) -> m a -> m b (<*) (_ :: Integer -> [Integer] -> Integer) (_ :: Integer -> b5) - where (<*) :: forall (f :: * -> *). + where (<*) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f a -> f b -> f a + f a -> f b -> f a (<$) (_ :: [Integer] -> Integer) (_ :: Integer -> b4) - where (<$) :: forall (f :: * -> *). + where (<$) :: forall (f :: * -> *) a b. Functor f => - forall a b. a -> f b -> f a + a -> f b -> f a id (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0) where id :: forall a. a -> a head (_ :: [t0 -> Integer -> [Integer] -> Integer]) (_ :: t0) @@ -261,15 +241,11 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] ($) (_ :: a5 -> Integer -> [Integer] -> Integer) (_ :: a5) where ($) :: forall a b. (a -> b) -> a -> b fail (_ :: String) (_ :: t0) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a return (_ :: Integer -> [Integer] -> Integer) (_ :: t0) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: Integer -> [Integer] -> Integer) (_ :: t0) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a uncurry (_ :: a4 -> b3 -> Integer -> [Integer] -> Integer) (_ :: (a4, b3)) where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c diff --git a/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr index bd23319b80..7e23fe8b86 100644 --- a/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/constraint_hole_fits.stderr @@ -14,43 +14,35 @@ constraint_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] g :: [a] -> a head :: forall a. [a] -> a last :: forall a. [a] -> a - maximum :: forall (t :: * -> *). - Foldable t => - forall a. Ord a => t a -> a - minimum :: forall (t :: * -> *). - Foldable t => - forall a. Ord a => t a -> a + maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a + minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a Valid refinement hole fits include foldl1 (_ :: a -> a -> a) - where foldl1 :: forall (t :: * -> *). + where foldl1 :: forall (t :: * -> *) a. Foldable t => - forall a. (a -> a -> a) -> t a -> a + (a -> a -> a) -> t a -> a foldr1 (_ :: a -> a -> a) - where foldr1 :: forall (t :: * -> *). + where foldr1 :: forall (t :: * -> *) a. Foldable t => - forall a. (a -> a -> a) -> t a -> a + (a -> a -> a) -> t a -> a foldl (_ :: a -> a -> a) (_ :: a) - where foldl :: forall (t :: * -> *). + where foldl :: forall (t :: * -> *) b a. Foldable t => - forall b a. (b -> a -> b) -> b -> t a -> b + (b -> a -> b) -> b -> t a -> b foldr (_ :: a -> a -> a) (_ :: a) - where foldr :: forall (t :: * -> *). + where foldr :: forall (t :: * -> *) a b. Foldable t => - forall a b. (a -> b -> b) -> b -> t a -> b + (a -> b -> b) -> b -> t a -> b const (_ :: a) where const :: forall a b. a -> b -> a ($) (_ :: [a] -> a) where ($) :: forall a b. (a -> b) -> a -> b fail (_ :: String) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a return (_ :: a) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a pure (_ :: a) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a ($!) (_ :: [a] -> a) where ($!) :: forall a b. (a -> b) -> a -> b id (_ :: [a] -> a) diff --git a/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr index f7acf41928..851e92e5fd 100644 --- a/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr @@ -22,9 +22,9 @@ free_monad_hole_fits.hs:14:28: warning: [-Wtyped-holes (in -Wdefault)] Constraints include Functor f (from free_monad_hole_fits.hs:10:10-38) Valid hole fits include - fmap :: forall (f :: * -> *). + fmap :: forall (f :: * -> *) a b. Functor f => - forall a b. (a -> b) -> f a -> f b + (a -> b) -> f a -> f b (<$>) :: forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b @@ -32,9 +32,7 @@ free_monad_hole_fits.hs:14:28: warning: [-Wtyped-holes (in -Wdefault)] ($) (_ :: (Free f a -> Free f b) -> f (Free f a) -> f (Free f b)) where ($) :: forall a b. (a -> b) -> a -> b pure (_ :: f (Free f a) -> f (Free f b)) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a free_monad_hole_fits.hs:25:31: warning: [-Wtyped-holes (in -Wdefault)] • Found hole: _a :: Free f a -> Free f b @@ -58,13 +56,13 @@ free_monad_hole_fits.hs:25:31: warning: [-Wtyped-holes (in -Wdefault)] Applicative f (from free_monad_hole_fits.hs:22:10-40) Valid refinement hole fits include fmap (_ :: a -> b) - where fmap :: forall (f :: * -> *). + where fmap :: forall (f :: * -> *) a b. Functor f => - forall a b. (a -> b) -> f a -> f b + (a -> b) -> f a -> f b (<*>) (_ :: Free f (a -> b)) - where (<*>) :: forall (f :: * -> *). + where (<*>) :: forall (f :: * -> *) a b. Applicative f => - forall a b. f (a -> b) -> f a -> f b + f (a -> b) -> f a -> f b (<$>) (_ :: a -> b) where (<$>) :: forall (f :: * -> *) a b. Functor f => @@ -76,6 +74,4 @@ free_monad_hole_fits.hs:25:31: warning: [-Wtyped-holes (in -Wdefault)] ($) (_ :: Free f a -> Free f b) where ($) :: forall a b. (a -> b) -> a -> b pure (_ :: Free f b) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a diff --git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr index 1df5b49dbb..429961c261 100644 --- a/testsuite/tests/typecheck/should_compile/holes.stderr +++ b/testsuite/tests/typecheck/should_compile/holes.stderr @@ -172,13 +172,13 @@ holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)] scanr :: forall a b. (a -> b -> b) -> b -> [a] -> [b] unzip :: forall a b. [(a, b)] -> ([a], [b]) (^^) :: forall a b. (Fractional a, Integral b) => a -> b -> a - ceiling :: forall a. RealFrac a => forall b. Integral b => a -> b - floor :: forall a. RealFrac a => forall b. Integral b => a -> b - properFraction :: forall a. - RealFrac a => - forall b. Integral b => a -> (b, a) - round :: forall a. RealFrac a => forall b. Integral b => a -> b - truncate :: forall a. RealFrac a => forall b. Integral b => a -> b + ceiling :: forall a b. (RealFrac a, Integral b) => a -> b + floor :: forall a b. (RealFrac a, Integral b) => a -> b + properFraction :: forall a b. + (RealFrac a, Integral b) => + a -> (b, a) + round :: forall a b. (RealFrac a, Integral b) => a -> b + truncate :: forall a b. (RealFrac a, Integral b) => a -> b Right :: forall a b. b -> Either a b Left :: forall a b. a -> Either a b ($) :: forall a b. (a -> b) -> a -> b diff --git a/testsuite/tests/typecheck/should_compile/holes3.stderr b/testsuite/tests/typecheck/should_compile/holes3.stderr index be14099d30..8d7f4a7a86 100644 --- a/testsuite/tests/typecheck/should_compile/holes3.stderr +++ b/testsuite/tests/typecheck/should_compile/holes3.stderr @@ -175,13 +175,13 @@ holes3.hs:11:15: error: scanr :: forall a b. (a -> b -> b) -> b -> [a] -> [b] unzip :: forall a b. [(a, b)] -> ([a], [b]) (^^) :: forall a b. (Fractional a, Integral b) => a -> b -> a - ceiling :: forall a. RealFrac a => forall b. Integral b => a -> b - floor :: forall a. RealFrac a => forall b. Integral b => a -> b - properFraction :: forall a. - RealFrac a => - forall b. Integral b => a -> (b, a) - round :: forall a. RealFrac a => forall b. Integral b => a -> b - truncate :: forall a. RealFrac a => forall b. Integral b => a -> b + ceiling :: forall a b. (RealFrac a, Integral b) => a -> b + floor :: forall a b. (RealFrac a, Integral b) => a -> b + properFraction :: forall a b. + (RealFrac a, Integral b) => + a -> (b, a) + round :: forall a b. (RealFrac a, Integral b) => a -> b + truncate :: forall a b. (RealFrac a, Integral b) => a -> b Right :: forall a b. b -> Either a b Left :: forall a b. a -> Either a b ($) :: forall a b. (a -> b) -> a -> b diff --git a/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr index 96e93bfd0f..77c7ae6e79 100644 --- a/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/refinement_hole_fits.stderr @@ -16,56 +16,48 @@ refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] with last @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.List’)) - maximum :: forall (t :: * -> *). - Foldable t => - forall a. Ord a => t a -> a + maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a with maximum @[] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) - minimum :: forall (t :: * -> *). - Foldable t => - forall a. Ord a => t a -> a + minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a with minimum @[] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) - product :: forall (t :: * -> *). - Foldable t => - forall a. Num a => t a -> a + product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a with product @[] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) - sum :: forall (t :: * -> *). - Foldable t => - forall a. Num a => t a -> a + sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a with sum @[] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) Valid refinement hole fits include foldl1 (_ :: Integer -> Integer -> Integer) - where foldl1 :: forall (t :: * -> *). + where foldl1 :: forall (t :: * -> *) a. Foldable t => - forall a. (a -> a -> a) -> t a -> a + (a -> a -> a) -> t a -> a with foldl1 @[] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) foldr1 (_ :: Integer -> Integer -> Integer) - where foldr1 :: forall (t :: * -> *). + where foldr1 :: forall (t :: * -> *) a. Foldable t => - forall a. (a -> a -> a) -> t a -> a + (a -> a -> a) -> t a -> a with foldr1 @[] @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) foldl (_ :: Integer -> Integer -> Integer) (_ :: Integer) - where foldl :: forall (t :: * -> *). + where foldl :: forall (t :: * -> *) b a. Foldable t => - forall b a. (b -> a -> b) -> b -> t a -> b + (b -> a -> b) -> b -> t a -> b with foldl @[] @Integer @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) foldr (_ :: Integer -> Integer -> Integer) (_ :: Integer) - where foldr :: forall (t :: * -> *). + where foldr :: forall (t :: * -> *) a b. Foldable t => - forall a b. (a -> b -> b) -> b -> t a -> b + (a -> b -> b) -> b -> t a -> b with foldr @[] @Integer @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) @@ -80,21 +72,17 @@ refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)] (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) fail (_ :: String) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a with fail @((->) [Integer]) @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) return (_ :: Integer) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) [Integer]) @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) pure (_ :: Integer) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) [Integer]) @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) @@ -141,26 +129,26 @@ refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] with const @Integer @[Integer] (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) [Integer]) @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) [Integer]) @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) Valid refinement hole fits include foldl (_ :: Integer -> Integer -> Integer) - where foldl :: forall (t :: * -> *). + where foldl :: forall (t :: * -> *) b a. Foldable t => - forall b a. (b -> a -> b) -> b -> t a -> b + (b -> a -> b) -> b -> t a -> b with foldl @[] @Integer @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) foldr (_ :: Integer -> Integer -> Integer) - where foldr :: forall (t :: * -> *). + where foldr :: forall (t :: * -> *) a b. Foldable t => - forall a b. (a -> b -> b) -> b -> t a -> b + (a -> b -> b) -> b -> t a -> b with foldr @[] @Integer @Integer (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘Data.Foldable’)) @@ -185,21 +173,17 @@ refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)] (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) fail (_ :: String) - where fail :: forall (m :: * -> *). - Monad m => - forall a. String -> m a + where fail :: forall (m :: * -> *) a. Monad m => String -> m a with fail @((->) Integer) @([Integer] -> Integer) (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) return (_ :: [Integer] -> Integer) - where return :: forall (m :: * -> *). Monad m => forall a. a -> m a + where return :: forall (m :: * -> *) a. Monad m => a -> m a with return @((->) Integer) @([Integer] -> Integer) (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) pure (_ :: [Integer] -> Integer) - where pure :: forall (f :: * -> *). - Applicative f => - forall a. a -> f a + where pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @((->) Integer) @([Integer] -> Integer) (imported from ‘Prelude’ at refinement_hole_fits.hs:1:8-30 (and originally defined in ‘GHC.Base’)) diff --git a/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr index bd2387f003..7751113761 100644 --- a/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/subsumption_sort_hole_fits.stderr @@ -25,15 +25,15 @@ subsumption_sort_hole_fits.hs:2:5: warning: [-Wtyped-holes (in -Wdefault)] with mempty @([Char] -> [String]) (imported from ‘Prelude’ at subsumption_sort_hole_fits.hs:1:1 (and originally defined in ‘GHC.Base’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @[] @String (imported from ‘Prelude’ at subsumption_sort_hole_fits.hs:1:1 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @[] @String (imported from ‘Prelude’ at subsumption_sort_hole_fits.hs:1:1 (and originally defined in ‘GHC.Base’)) - fail :: forall (m :: * -> *). Monad m => forall a. String -> m a + fail :: forall (m :: * -> *) a. Monad m => String -> m a with fail @[] @String (imported from ‘Prelude’ at subsumption_sort_hole_fits.hs:1:1 (and originally defined in ‘GHC.Base’)) diff --git a/testsuite/tests/typecheck/should_compile/tc231.stderr b/testsuite/tests/typecheck/should_compile/tc231.stderr index 73caa90c19..485370c1e7 100644 --- a/testsuite/tests/typecheck/should_compile/tc231.stderr +++ b/testsuite/tests/typecheck/should_compile/tc231.stderr @@ -5,8 +5,7 @@ TYPE SIGNATURES 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 () + huh :: forall s a b chain. Zork s a b => 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 @@ -20,4 +19,4 @@ COERCION AXIOMS -- Defined at tc231.hs:25:1 Dependent modules: [] Dependent packages: [base-4.12.0.0, ghc-prim-0.5.3, - integer-gmp-1.0.2.0] + integer-simple-0.1.1.1] diff --git a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr index a87bea1268..6ddc274e72 100644 --- a/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr +++ b/testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr @@ -24,11 +24,11 @@ valid_hole_fits.hs:17:17: warning: [-Wtyped-holes (in -Wdefault)] c :: Int -> IO Int (bound at valid_hole_fits.hs:16:1) a :: Int -> IO Int (bound at valid_hole_fits.hs:12:1) b :: Int -> IO Int (bound at valid_hole_fits.hs:14:1) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @IO @Int (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @IO @Int (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 (and originally defined in ‘GHC.Base’)) @@ -79,11 +79,11 @@ valid_hole_fits.hs:27:5: warning: [-Wtyped-holes (in -Wdefault)] with Just @Integer (imported from ‘Data.Maybe’ at valid_hole_fits.hs:5:1-17 (and originally defined in ‘GHC.Base’)) - return :: forall (m :: * -> *). Monad m => forall a. a -> m a + return :: forall (m :: * -> *) a. Monad m => a -> m a with return @Maybe @Integer (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 (and originally defined in ‘GHC.Base’)) - pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a + pure :: forall (f :: * -> *) a. Applicative f => a -> f a with pure @Maybe @Integer (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 (and originally defined in ‘GHC.Base’)) @@ -245,7 +245,7 @@ valid_hole_fits.hs:37:8: warning: [-Wtyped-holes (in -Wdefault)] with print @[Char] (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 (and originally defined in ‘System.IO’)) - fail :: forall (m :: * -> *). Monad m => forall a. String -> m a + fail :: forall (m :: * -> *) a. Monad m => String -> m a with fail @IO @() (imported from ‘Prelude’ at valid_hole_fits.hs:3:1-40 (and originally defined in ‘GHC.Base’)) diff --git a/testsuite/tests/typecheck/should_fail/T12083b.stderr b/testsuite/tests/typecheck/should_fail/T12083b.stderr index 39ceeced74..ae9d48754c 100644 --- a/testsuite/tests/typecheck/should_fail/T12083b.stderr +++ b/testsuite/tests/typecheck/should_fail/T12083b.stderr @@ -3,5 +3,5 @@ T12083b.hs:6:5: error: • Illegal qualified type: Eq a => r Perhaps you intended to use RankNTypes or Rank2Types • When checking the class method: - test :: forall a. Class a => forall r. a -> (Eq a => r) -> r + test :: forall a r. Class a => a -> (Eq a => r) -> r In the class declaration for ‘Class’ diff --git a/testsuite/tests/typecheck/should_fail/T12151.stderr b/testsuite/tests/typecheck/should_fail/T12151.stderr index 4b233d8b64..8a4831c535 100644 --- a/testsuite/tests/typecheck/should_fail/T12151.stderr +++ b/testsuite/tests/typecheck/should_fail/T12151.stderr @@ -9,7 +9,7 @@ T12151.hs:9:13: error: • Could not deduce (Put a0) from the context: Put a bound by the type signature for: - put :: forall a. Put a => forall t. t + put :: forall a t. Put a => t at T12151.hs:9:13-15 The type variable ‘a0’ is ambiguous • In the ambiguity check for ‘put’ diff --git a/testsuite/tests/typecheck/should_fail/T12918b.stderr b/testsuite/tests/typecheck/should_fail/T12918b.stderr index 92aa85e9f3..3492ca6415 100644 --- a/testsuite/tests/typecheck/should_fail/T12918b.stderr +++ b/testsuite/tests/typecheck/should_fail/T12918b.stderr @@ -3,34 +3,34 @@ T12918b.hs:8:11: error: • The default type signature for bar1: forall b. b -> a does not match its corresponding non-default type signature • When checking the class method: - bar1 :: forall a. Foo1 a => forall b. a -> b + bar1 :: forall a b. Foo1 a => a -> b In the class declaration for ‘Foo1’ T12918b.hs:12:11: error: • The default type signature for bar2: forall x. x does not match its corresponding non-default type signature • When checking the class method: - bar2 :: forall a. Foo1 a => forall b. a -> b + bar2 :: forall a b. Foo1 a => a -> b In the class declaration for ‘Foo1’ T12918b.hs:12:11: error: • Could not deduce (Foo1 a0) from the context: Foo1 a bound by the type signature for: - bar2 :: forall a. Foo1 a => forall x. x + bar2 :: forall a x. Foo1 a => x at T12918b.hs:12:11-14 The type variable ‘a0’ is ambiguous • In the ambiguity check for ‘bar2’ To defer the ambiguity check to use sites, enable AllowAmbiguousTypes When checking the class method: - bar2 :: forall a. Foo1 a => forall b. a -> b + bar2 :: forall a b. Foo1 a => a -> b In the class declaration for ‘Foo1’ T12918b.hs:16:11: error: • The default type signature for bar3: a -> Int does not match its corresponding non-default type signature • When checking the class method: - bar3 :: forall a. Foo1 a => forall b. a -> b + bar3 :: forall a b. Foo1 a => a -> b In the class declaration for ‘Foo1’ T12918b.hs:20:11: error: diff --git a/testsuite/tests/typecheck/should_fail/T14884.stderr b/testsuite/tests/typecheck/should_fail/T14884.stderr index 11008b316a..8adae18262 100644 --- a/testsuite/tests/typecheck/should_fail/T14884.stderr +++ b/testsuite/tests/typecheck/should_fail/T14884.stderr @@ -13,9 +13,9 @@ T14884.hs:4:5: error: with mapM_ @[] @IO @Char @() (imported from ‘Prelude’ at T14884.hs:1:8-13 (and originally defined in ‘Data.Foldable’)) - foldMap :: forall (t :: * -> *). - Foldable t => - forall m a. Monoid m => (a -> m) -> t a -> m + foldMap :: forall (t :: * -> *) m a. + (Foldable t, Monoid m) => + (a -> m) -> t a -> m with foldMap @[] @(IO ()) @Char (imported from ‘Prelude’ at T14884.hs:1:8-13 (and originally defined in ‘Data.Foldable’)) diff --git a/testsuite/tests/typecheck/should_fail/T7437.stderr b/testsuite/tests/typecheck/should_fail/T7437.stderr index d6663df40e..9b75781411 100644 --- a/testsuite/tests/typecheck/should_fail/T7437.stderr +++ b/testsuite/tests/typecheck/should_fail/T7437.stderr @@ -11,9 +11,7 @@ T7437.hs:14:13: error: • Could not deduce (Put a0) from the context: (Put a, Generic t, GPut (Rep t)) bound by the type signature for: - put :: forall a. - Put a => - forall t. (Generic t, GPut (Rep t)) => t -> [()] + put :: forall a t. (Put a, Generic t, GPut (Rep t)) => t -> [()] at T7437.hs:14:13-15 The type variable ‘a0’ is ambiguous • In the ambiguity check for ‘put’ |