Simon Peyton Jones pushed to branch wip/T26868 at Glasgow Haskell Compiler / GHC Commits: 946aef8b by Simon Peyton Jones at 2026-03-09T17:45:59+00:00 Wibbles [skip ci] - - - - - bdaba642 by Simon Peyton Jones at 2026-03-09T17:45:59+00:00 Quick fixes after talking with Richard [skip ci] Needs fixups - - - - - 21 changed files: - compiler/GHC/Core.hs - compiler/GHC/Types/Var/FV.hs - compiler/GHC/Utils/EndoOS.hs - testsuite/tests/polykinds/T7328.stderr - testsuite/tests/simplCore/should_compile/DsSpecPragmas.stderr - testsuite/tests/simplCore/should_compile/T24229a.stderr - testsuite/tests/simplCore/should_compile/T24229b.stderr - testsuite/tests/simplCore/should_compile/T24359a.stderr - testsuite/tests/simplCore/should_compile/T26116.stderr - testsuite/tests/simplCore/should_compile/T4908.stderr - testsuite/tests/simplCore/should_compile/spec-inline.stderr - testsuite/tests/typecheck/no_skolem_info/T20063.stderr - testsuite/tests/typecheck/should_compile/T25180.stderr - testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr - testsuite/tests/typecheck/should_fail/T10971d.stderr - testsuite/tests/typecheck/should_fail/T12589.stderr - testsuite/tests/typecheck/should_fail/T13311.stderr - testsuite/tests/typecheck/should_fail/T17773.stderr - testsuite/tests/typecheck/should_fail/T2846b.stderr - testsuite/tests/typecheck/should_fail/T7851.stderr - testsuite/tests/typecheck/should_fail/T8603.stderr Changes: ===================================== compiler/GHC/Core.hs ===================================== @@ -409,7 +409,7 @@ Consider applying `exprType` to this term: where we have genuine shadowing: both lambdas bind the same a. Remember: every occurrence of `x` is just a copy of the binder (x::[a]), and ditto `y`. -Now what does `exprType` return for that term? It will return the bogus type +Now what does `exprType` return for that term? It will return the incorrect type forall a. [a] -> forall a. a -> ([a],a) ===================================== compiler/GHC/Types/Var/FV.hs ===================================== @@ -136,9 +136,9 @@ type InterestingVarFun = Var -> Bool type BoundVars = TyCoVarSet -type VarSetFV = FV BoundVars (EndoOS TyCoVarSet) -type DVarSetFV = FV BoundVars (EndoOS DTyCoVarSet) -type SelectiveFV = FV (InterestingVarFun, BoundVars) (EndoOS DVarSet) +type VarSetFV = FV BoundVars (EndoOS TyCoVarSet) +type DVarSetFV = FV BoundVars (EndoOS DTyCoVarSet) +type SelectiveDFV = FV (InterestingVarFun, BoundVars) (EndoOS DVarSet) -- VarSetFV: collects a VarSet -- DVarSetFV: collects a DVarSet (deterministic) -- SelectiveFV: selectively collects a DVarSet ===================================== compiler/GHC/Utils/EndoOS.hs ===================================== @@ -9,7 +9,7 @@ -- -- It is also strict: see the (<>) method in he Semigroup instance -module GHC.Utils.EndoOS( EndoOS(EndoOS, runEndoOS ), foldEndoOS ) where +module GHC.Utils.EndoOS( EndoOS(EndoOS, runEndoOS ) ) where import GHC.Prelude @@ -40,6 +40,3 @@ pattern EndoOS f <- EndoOS' f EndoOS f = EndoOS' (oneShot f) -- oneShot: this is the core of the one-shot trick! -- Note [The one-shot state monad trick] in GHC.Utils.Monad. - -foldEndoOS :: Foldable t => (a -> Endo b) -> t a -> Endo b -foldEndoOS f xs = foldr ((<>) . f) mempty xs ===================================== testsuite/tests/polykinds/T7328.stderr ===================================== @@ -1,6 +1,6 @@ - T7328.hs:8:34: error: [GHC-27958] - • Expected kind ‘k1’, but ‘f’ has kind ‘k0 -> k1’ + • Expected kind ‘k0’, but ‘f’ has kind ‘k1 -> k0’ • In the first argument of ‘Foo’, namely ‘f’ In the first argument of ‘Proxy’, namely ‘(Foo f)’ In the type signature: foo :: a ~ f i => Proxy (Foo f) + ===================================== testsuite/tests/simplCore/should_compile/DsSpecPragmas.stderr ===================================== @@ -1,78 +1,78 @@ ==================== Tidy Core rules ==================== "USPEC f1 @Word @[e]" - forall (@e) ($dEq :: Eq [e]) ($dNum :: Num Word). + forall (@e) ($dNum :: Num Word) ($dEq :: Eq [e]). f1 @Word @[e] $dNum $dEq = \ _ [Occ=Dead] _ [Occ=Dead] -> I# 111# "USPEC f1 @Word @_" - forall (@e) ($dEq :: Eq e) ($dNum :: Num Word). + forall (@e) ($dNum :: Num Word) ($dEq :: Eq e). f1 @Word @e $dNum $dEq = \ _ [Occ=Dead] _ [Occ=Dead] -> I# 111# "USPEC f1_qc @_ @(g e) @Word" - forall (@e) - (@(g :: * -> *)) - ($dNum :: Num Word) + forall (@(g :: * -> *)) + (@e) + (df :: forall x. Eq x => Eq (g x)) ($dEq :: Eq (g e)) - (df :: forall x. Eq x => Eq (g x)). + ($dNum :: Num Word). f1_qc @g @(g e) @Word df $dEq $dNum = \ _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> C# 'q'# "USPEC f2 @_ @_ @Word" - forall (@c) ($dNum :: Num Word) ($dEq :: Eq c) ($dEq1 :: Eq c). - f2 @c @c @Word $dEq1 $dEq $dNum + forall (@c) ($dEq :: Eq c) ($dEq1 :: Eq c) ($dNum :: Num Word). + f2 @c @c @Word $dEq $dEq1 $dNum = \ _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> I# 2# "USPEC f3 @Int @_" forall (@(g :: * -> *)) - (df :: forall x. Eq x => Eq (g x)) - ($dEq :: Eq Int). + ($dEq :: Eq Int) + (df :: forall x. Eq x => Eq (g x)). f3 @Int @g $dEq df = f3_$sf3 @g df "USPEC f3 @_ @[]" - forall (@c) (df :: forall x. Eq x => Eq [x]) ($dEq :: Eq c). + forall (@c) ($dEq :: Eq c) (df :: forall x. Eq x => Eq [x]). f3 @c @[] $dEq df = f3_$sf1 @c $dEq "USPEC f4 @_ @(ST s)" - forall (@s) (@b) ($dMonad :: Monad (ST s)) ($dEq :: Eq b). + forall (@b) (@s) ($dEq :: Eq b) ($dMonad :: Monad (ST s)). f4 @b @(ST s) $dEq $dMonad = $fApplicativeST_$cpure @s @b "USPEC f4_qc @Int @_ @_" - forall (@(n :: * -> *)) - (@(r :: (* -> *) -> * -> *)) - (df :: forall (m :: * -> *). Monad m => Monad (r m)) - ($dEq :: Eq Int). + forall (@(r :: (* -> *) -> * -> *)) + (@(n :: * -> *)) + ($dEq :: Eq Int) + (df :: forall (m :: * -> *). Monad m => Monad (r m)). f4_qc @Int @r @n $dEq df = \ _ [Occ=Dead] -> () "USPEC f5 @(D Int)" forall ($dEq :: Eq (D Int)). f5 @(D Int) $dEq = f5_$sf5 "USPEC f5_qc @Int @D" - forall (df :: forall x. (Eq x, Eq (T x)) => Eq (D x)) - ($dEq :: Eq (T Int)) - ($dEq1 :: Eq Int). - f5_qc @Int @D $dEq1 $dEq df + forall ($dEq :: Eq Int) + ($dEq1 :: Eq (T Int)) + (df :: forall x. (Eq x, Eq (T x)) => Eq (D x)). + f5_qc @Int @D $dEq $dEq1 df = f5_$sf5 "USPEC f5_qc @Int @_" forall (@(g :: * -> *)) - (df :: forall x. (Eq x, Eq (T x)) => Eq (g x)) - ($dEq :: Eq (T Int)) - ($dEq1 :: Eq Int). - f5_qc @Int @g $dEq1 $dEq df + ($dEq :: Eq Int) + ($dEq1 :: Eq (T Int)) + (df :: forall x. (Eq x, Eq (T x)) => Eq (g x)). + f5_qc @Int @g $dEq $dEq1 df = f5_qc_$sf5_qc @g df "USPEC f6 @_ @_ @Word" - forall (@c) ($dNum :: Num Word) ($dOrd :: Ord c) ($dEq :: Eq c). + forall (@c) ($dEq :: Eq c) ($dOrd :: Ord c) ($dNum :: Num Word). f6 @c @c @Word $dEq $dOrd $dNum = \ _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> C# 'c'# "USPEC f6_qc @_ @_ @Word" forall (@(h :: * -> *)) - ($dNum :: Num Word) - (df :: forall y. Eq y => Ord (h y)) - (df1 :: forall x. Eq x => Eq (h x)). - f6_qc @h @h @Word df1 df $dNum + (df :: forall x. Eq x => Eq (h x)) + (df1 :: forall y. Eq y => Ord (h y)) + ($dNum :: Num Word). + f6_qc @h @h @Word df df1 $dNum = \ _ [Occ=Dead] _ [Occ=Dead] _ [Occ=Dead] -> C# 'd'# "USPEC f7 @Int" - forall ($dEq :: Eq Int) ($dCls :: Cls (TF Int)). + forall ($dCls :: Cls (TF Int)) ($dEq :: Eq Int). f7 @Int $dCls $dEq = \ (x [Occ=Once1] :: Int) -> x "USPEC qcfd @C @G" - forall (df :: forall a b. C (a, b)) ($dF :: F C G). + forall ($dF :: F C G) (df :: forall a b. C (a, b)). qcfd @C @G $dF df = qcfd_x ===================================== testsuite/tests/simplCore/should_compile/T24229a.stderr ===================================== @@ -5,9 +5,9 @@ Result size of Tidy Core = {terms: 79, types: 106, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo = \ @a sc sc1 sc2 -> - case sc2 of ds { - __DEFAULT -> foo_$s$wfoo sc1 sc (-# ds 1#); - 0# -> (# (sc, sc1) #) + case sc of ds { + __DEFAULT -> foo_$s$wfoo (-# ds 1#) sc2 sc1; + 0# -> (# (sc1, sc2) #) } end Rec } @@ -15,7 +15,7 @@ foo = \ @a ds ds1 -> case ds of { I# ww -> case ww of ds2 { - __DEFAULT -> case ds1 `cast` Co:4 :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + __DEFAULT -> case ds1 `cast` Co:4 :: ... of { (x, y) -> case foo_$s$wfoo (-# ds2 1#) y x of { (# ww1 #) -> Just ww1 } }; 0# -> Just (ds1 `cast` Co:4 :: ...) } } @@ -28,11 +28,11 @@ wombat5 = "no"# wombat4 = unpackCString# wombat5 -wombat1 = case foo_$s$wfoo wombat6 wombat4 20# of { (# ww #) -> Just ww } +wombat1 = case foo_$s$wfoo 20# wombat6 wombat4 of { (# ww #) -> Just ww } wombat8 = I# 3# -wombat2 = \ @a xs ys -> case foo_$s$wfoo xs ys 3# of { (# ww #) -> Just ww } +wombat2 = \ @a xs ys -> case foo_$s$wfoo 3# xs ys of { (# ww #) -> Just ww } ===================================== testsuite/tests/simplCore/should_compile/T24229b.stderr ===================================== @@ -5,9 +5,9 @@ Result size of Tidy Core = {terms: 60, types: 83, coercions: 8, joins: 0/0} Rec { foo_$s$wfoo = \ @a sc sc1 sc2 -> - case sc2 of ds { - __DEFAULT -> foo_$s$wfoo sc1 sc (-# ds 1#); - 0# -> (# (sc, sc1) #) + case sc of ds { + __DEFAULT -> foo_$s$wfoo (-# ds 1#) sc2 sc1; + 0# -> (# (sc1, sc2) #) } end Rec } @@ -15,14 +15,14 @@ foo = \ @a ds ds1 -> case ds of { I# ww -> case ww of ds2 { - __DEFAULT -> case ds1 `cast` Co:4 :: ... of { (x, y) -> case foo_$s$wfoo y x (-# ds2 1#) of { (# ww1 #) -> Just ww1 } }; + __DEFAULT -> case ds1 `cast` Co:4 :: ... of { (x, y) -> case foo_$s$wfoo (-# ds2 1#) y x of { (# ww1 #) -> Just ww1 } }; 0# -> Just (ds1 `cast` Co:4 :: ...) } } wombat1 = I# 3# -wombat2 = \ @a xs ys -> case foo_$s$wfoo xs ys 3# of { (# ww #) -> Just ww } +wombat2 = \ @a xs ys -> case foo_$s$wfoo 3# xs ys of { (# ww #) -> Just ww } ===================================== testsuite/tests/simplCore/should_compile/T24359a.stderr ===================================== @@ -1,7 +1,8 @@ ==================== Tidy Core rules ==================== "USPEC showsIArray @UA @_" - forall (@i) ($dShow :: Show i) ($dIArray :: IArray UA). + forall (@i) ($dIArray :: IArray UA) ($dShow :: Show i). showsIArray @UA @i $dIArray $dShow = showsIArray_$sshowsIArray @i $dShow + ===================================== testsuite/tests/simplCore/should_compile/T26116.stderr ===================================== @@ -1,11 +1,11 @@ ==================== Tidy Core rules ==================== "USPEC $cop1 @T @_" - forall (@a) ($dD :: D a) ($dEq :: Eq (T a)). + forall (@a) ($dEq :: Eq (T a)) ($dD :: D a). $fCTYPEfa_$cop1 @T @a $dEq $dD = \ _ [Occ=Dead] -> I# 3# "USPEC $fCTYPEfa @T @_" - forall (@a) ($dD :: D a) ($dEq :: Eq (T a)). + forall (@a) ($dEq :: Eq (T a)) ($dD :: D a). $fCTYPEfa @T @a $dEq $dD = $fCTYPEfa_$s$fCTYPEfa @a $dD ===================================== testsuite/tests/simplCore/should_compile/T4908.stderr ===================================== @@ -47,14 +47,14 @@ T4908.$trModule Rec { -- RHS size: {terms: 19, types: 5, coercions: 0, joins: 0/0} T4908.f_$s$wf [InlPrag=[2], Occ=LoopBreaker] - :: Int -> Int# -> Int# -> (# #) -[GblId, Arity=3, Str=<A><ML><1L>, Unf=OtherCon []] + :: Int# -> Int -> Int# -> (# #) +[GblId, Arity=3, Str=<1L><A><ML>, Unf=OtherCon []] T4908.f_$s$wf - = \ (sc :: Int) (sc1 :: Int#) (sc2 :: Int#) -> - case sc2 of ds { + = \ (sc :: Int#) (sc1 :: Int) (sc2 :: Int#) -> + case sc of ds { __DEFAULT -> - case sc1 of ds1 { - __DEFAULT -> T4908.f_$s$wf sc ds1 (-# ds 1#); + case sc2 of ds1 { + __DEFAULT -> T4908.f_$s$wf (-# ds 1#) sc1 ds1; 0# -> GHC.Internal.Types.(##) }; 0# -> GHC.Internal.Types.(##) @@ -78,7 +78,7 @@ f [InlPrag=[2]] :: Int -> (Int, Int) -> Bool case b of { I# ds2 [Occ=Once1!] -> case ds2 of ds3 [Occ=Once1] { __DEFAULT -> - case T4908.f_$s$wf a ds3 (-# ds1 1#) of { (# #) -> + case T4908.f_$s$wf (-# ds1 1#) a ds3 of { (# #) -> GHC.Internal.Types.True }; 0# -> GHC.Internal.Types.True @@ -96,7 +96,7 @@ f = \ (ds :: Int) (x :: (Int, Int)) -> case b of { I# ds2 -> case ds2 of ds3 { __DEFAULT -> - case T4908.f_$s$wf a ds3 (-# ds1 1#) of { (# #) -> + case T4908.f_$s$wf (-# ds1 1#) a ds3 of { (# #) -> GHC.Internal.Types.True }; 0# -> GHC.Internal.Types.True ===================================== testsuite/tests/simplCore/should_compile/spec-inline.stderr ===================================== @@ -20,23 +20,23 @@ Rec { Roman.foo_$s$wgo [InlPrag=[2], Occ=LoopBreaker] :: GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -> GHC.Internal.Prim.Int# -[GblId, Arity=2, Str=<A><L>, Unf=OtherCon []] +[GblId, Arity=2, Str=<L><A>, Unf=OtherCon []] Roman.foo_$s$wgo = \ (sc :: GHC.Internal.Prim.Int#) (sc1 :: GHC.Internal.Prim.Int#) -> - case GHC.Internal.Prim.<=# sc1 0# of { + case GHC.Internal.Prim.<=# sc 0# of { __DEFAULT -> - case GHC.Internal.Prim.<# sc1 100# of { + case GHC.Internal.Prim.<# sc 100# of { __DEFAULT -> - case GHC.Internal.Prim.<# sc1 500# of { + case GHC.Internal.Prim.<# sc 500# of { __DEFAULT -> Roman.foo_$s$wgo - (GHC.Internal.Prim.*# 14# sc) (GHC.Internal.Prim.-# sc1 1#); + (GHC.Internal.Prim.-# sc 1#) (GHC.Internal.Prim.*# 14# sc1); 1# -> Roman.foo_$s$wgo - (GHC.Internal.Prim.*# 7# sc) (GHC.Internal.Prim.-# sc1 3#) + (GHC.Internal.Prim.-# sc 3#) (GHC.Internal.Prim.*# 7# sc1) }; - 1# -> Roman.foo_$s$wgo sc (GHC.Internal.Prim.-# sc1 2#) + 1# -> Roman.foo_$s$wgo (GHC.Internal.Prim.-# sc 2#) sc1 }; 1# -> 0# } @@ -58,7 +58,7 @@ Roman.$wgo Just x -> case x of { GHC.Internal.Types.I# ipv -> case u of { - Nothing -> Roman.foo_$s$wgo (GHC.Internal.Prim.*# 7# ipv) 10#; + Nothing -> Roman.foo_$s$wgo 10# (GHC.Internal.Prim.*# 7# ipv); Just n -> case n of { GHC.Internal.Types.I# x2 -> case GHC.Internal.Prim.<=# x2 0# of { @@ -68,12 +68,12 @@ Roman.$wgo case GHC.Internal.Prim.<# x2 500# of { __DEFAULT -> Roman.foo_$s$wgo - (GHC.Internal.Prim.*# 14# ipv) (GHC.Internal.Prim.-# x2 1#); + (GHC.Internal.Prim.-# x2 1#) (GHC.Internal.Prim.*# 14# ipv); 1# -> Roman.foo_$s$wgo - (GHC.Internal.Prim.*# 7# ipv) (GHC.Internal.Prim.-# x2 3#) + (GHC.Internal.Prim.-# x2 3#) (GHC.Internal.Prim.*# 7# ipv) }; - 1# -> Roman.foo_$s$wgo ipv (GHC.Internal.Prim.-# x2 2#) + 1# -> Roman.foo_$s$wgo (GHC.Internal.Prim.-# x2 2#) ipv }; 1# -> 0# } @@ -134,7 +134,7 @@ foo :: Int -> Int foo = \ (n :: Int) -> case n of { GHC.Internal.Types.I# ipv -> - case Roman.foo_$s$wgo 6# ipv of ww { __DEFAULT -> + case Roman.foo_$s$wgo ipv 6# of ww { __DEFAULT -> GHC.Internal.Types.I# ww } } @@ -145,8 +145,8 @@ foo forall (sc :: GHC.Internal.Prim.Int#) (sc1 :: GHC.Internal.Prim.Int#). Roman.$wgo (GHC.Internal.Maybe.Just - @Int (GHC.Internal.Types.I# sc1)) - (GHC.Internal.Maybe.Just @Int (GHC.Internal.Types.I# sc)) + @Int (GHC.Internal.Types.I# sc)) + (GHC.Internal.Maybe.Just @Int (GHC.Internal.Types.I# sc1)) = Roman.foo_$s$wgo sc sc1 ===================================== testsuite/tests/typecheck/no_skolem_info/T20063.stderr ===================================== @@ -1,23 +1,23 @@ T20063.hs:25:21: error: [GHC-25897] - • Could not deduce ‘ctx6 ~ (ctx0 :*& l0)’ - from the context: (ctx4 ~ Extend ctx1, ctx5 ~ Extend ctx2) + • Could not deduce ‘ctx4 ~ (ctx0 :*& l0)’ + from the context: (ctx1 ~ Extend ctx2, ctx2 ~ Extend ctx1) bound by a pattern with constructor: U :: forall {k} (ctx1 :: Context) (ctx2 :: Context) (l :: k). Rn ctx1 ctx2 -> Rn (ctx1 :*& l) (ctx2 :*& l), in an equation for ‘rnRename’ at T20063.hs:25:11-13 - Expected: Idx ctx6 + Expected: Idx ctx4 Actual: Idx (ctx0 :*& l0) - ‘ctx6’ is a rigid type variable bound by + ‘ctx4’ is a rigid type variable bound by the type signature for: - rnRename :: forall (ctx4 :: Context) (ctx5 :: Context) - (ctx3 :: Context) (ctx6 :: Context). - Rn ctx4 ctx5 -> Idx ctx3 -> Idx ctx6 + rnRename :: forall (ctx7 :: Context) (ctx8 :: Context) + (ctx3 :: Context) (ctx4 :: Context). + Rn ctx7 ctx8 -> Idx ctx3 -> Idx ctx4 at T20063.hs:24:1-48 • In the expression: T _ In an equation for ‘rnRename’: rnRename (U _) _ = T _ • Relevant bindings include - rnRename :: Rn ctx4 ctx5 -> Idx ctx3 -> Idx ctx6 + rnRename :: Rn ctx7 ctx8 -> Idx ctx3 -> Idx ctx4 (bound at T20063.hs:25:1) T20063.hs:26:17: error: [GHC-27346] ===================================== testsuite/tests/typecheck/should_compile/T25180.stderr ===================================== @@ -146,7 +146,7 @@ T25180.hs:66:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] T25180.hs:73:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _ :: b -> (# a | b #) - Where: ‘a’, ‘b’ are rigid type variables bound by + Where: ‘b’, ‘a’ are rigid type variables bound by the type signature for: usum2_2 :: forall b a. b -> (# a | b #) at T25180.hs:72:1-27 @@ -176,7 +176,7 @@ T25180.hs:80:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] T25180.hs:87:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _ :: b -> (# a | b | c #) - Where: ‘a’, ‘b’, ‘c’ are rigid type variables bound by + Where: ‘b’, ‘a’, ‘c’ are rigid type variables bound by the type signature for: usum3_2 :: forall b a c. b -> (# a | b | c #) at T25180.hs:86:1-31 @@ -191,7 +191,7 @@ T25180.hs:87:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] T25180.hs:94:11: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _ :: c -> (# a | b | c #) - Where: ‘a’, ‘b’, ‘c’ are rigid type variables bound by + Where: ‘c’, ‘a’, ‘b’ are rigid type variables bound by the type signature for: usum3_3 :: forall c a b. c -> (# a | b | c #) at T25180.hs:93:1-31 ===================================== testsuite/tests/typecheck/should_compile/free_monad_hole_fits.stderr ===================================== @@ -1,13 +1,13 @@ free_monad_hole_fits.hs:14:28: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _a :: (Free f a -> Free f b) -> f (Free f a) -> f (Free f b) - Where: ‘a’, ‘b’ are rigid type variables bound by + Where: ‘f’ is a rigid type variable bound by + the instance declaration + at free_monad_hole_fits.hs:10:10-38 + ‘a’, ‘b’ are rigid type variables bound by the type signature for: fmap :: forall a b. (a -> b) -> Free f a -> Free f b at free_monad_hole_fits.hs:11:5-8 - ‘f’ is a rigid type variable bound by - the instance declaration - at free_monad_hole_fits.hs:10:10-38 Or perhaps ‘_a’ is mis-spelled, or not in scope • In the first argument of ‘Free’, namely ‘(_a go fa)’ In the expression: Free (_a go fa) @@ -35,13 +35,13 @@ free_monad_hole_fits.hs:14:28: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault free_monad_hole_fits.hs:25:31: warning: [GHC-88464] [-Wtyped-holes (in -Wdefault)] • Found hole: _a :: Free f a -> Free f b - Where: ‘a’, ‘b’ are rigid type variables bound by + Where: ‘f’ is a rigid type variable bound by + the instance declaration + at free_monad_hole_fits.hs:22:10-40 + ‘a’, ‘b’ are rigid type variables bound by the type signature for: (>>=) :: forall a b. Free f a -> (a -> Free f b) -> Free f b at free_monad_hole_fits.hs:23:12-14 - ‘f’ is a rigid type variable bound by - the instance declaration - at free_monad_hole_fits.hs:22:10-40 Or perhaps ‘_a’ is mis-spelled, or not in scope • In the first argument of ‘fmap’, namely ‘_a’ In the first argument of ‘Free’, namely ‘(fmap _a f)’ ===================================== testsuite/tests/typecheck/should_fail/T10971d.stderr ===================================== @@ -1,21 +1,21 @@ - T10971d.hs:4:14: error: [GHC-83865] - • Couldn't match expected type: [a0] - with actual type: Maybe a3 + • Couldn't match expected type: [a1] + with actual type: Maybe a0 • In the first argument of ‘f’, namely ‘(Just 1)’ In the second argument of ‘($)’, namely ‘f (Just 1)’ In a stmt of a 'do' block: print $ f (Just 1) T10971d.hs:5:19: error: [GHC-83865] • Couldn't match expected type: [b0] - with actual type: Maybe a4 + with actual type: Maybe a2 • In the second argument of ‘g’, namely ‘(Just 5)’ In the second argument of ‘($)’, namely ‘g (+ 1) (Just 5)’ In a stmt of a 'do' block: print $ g (+ 1) (Just 5) T10971d.hs:6:23: error: [GHC-83865] - • Couldn't match expected type: [a2] - with actual type: Maybe a1 + • Couldn't match expected type: [a4] + with actual type: Maybe a3 • In the second argument of ‘h’, namely ‘Nothing’ In the second argument of ‘($)’, namely ‘h (const 5) Nothing’ In a stmt of a 'do' block: print $ h (const 5) Nothing + ===================================== testsuite/tests/typecheck/should_fail/T12589.stderr ===================================== @@ -1,3 +1,3 @@ - T12589.hs:13:3: error: [GHC-88464] - Variable not in scope: (&) :: t0 -> t1 -> t + Variable not in scope: (&) :: t1 -> t0 -> t + ===================================== testsuite/tests/typecheck/should_fail/T13311.stderr ===================================== @@ -1,7 +1,6 @@ - T13311.hs:9:3: error: [GHC-83865] - • Couldn't match expected type: IO a0 - with actual type: Maybe a1 -> Maybe b0 + • Couldn't match expected type: IO a1 + with actual type: Maybe a0 -> Maybe b0 • Probable cause: ‘f’ is applied to too few arguments In a stmt of a 'do' block: f In the expression: @@ -10,3 +9,4 @@ T13311.hs:9:3: error: [GHC-83865] In an equation for ‘g’: g = do f putChar 'a' + ===================================== testsuite/tests/typecheck/should_fail/T17773.stderr ===================================== @@ -1,7 +1,6 @@ - T17773.hs:16:22: error: [GHC-88464] • Found hole: _Refl :: Mzero x y :~: (x <|> y) - Where: ‘x’, ‘f’, ‘k’, ‘a’, ‘y’ are rigid type variables bound by + Where: ‘k’, ‘f’, ‘a’, ‘x’, ‘y’ are rigid type variables bound by the type signature for: monadPlusMplus :: forall {k} (f :: k -> *) (a :: k) (x :: f a) (y :: f a). @@ -12,3 +11,4 @@ T17773.hs:16:22: error: [GHC-88464] • Relevant bindings include monadPlusMplus :: Proxy x -> Proxy y -> Mzero x y :~: (x <|> y) (bound at T17773.hs:16:1) + ===================================== testsuite/tests/typecheck/should_fail/T2846b.stderr ===================================== @@ -1,10 +1,10 @@ - T2846b.hs:5:10: error: [GHC-91028] - • Couldn't match expected type ‘a1’ - with actual type ‘[Num a0 => a0]’ - Cannot instantiate unification variable ‘a1’ - with a type involving polytypes: [Num a0 => a0] + • Couldn't match expected type ‘a0’ + with actual type ‘[Num a1 => a1]’ + Cannot instantiate unification variable ‘a0’ + with a type involving polytypes: [Num a1 => a1] • In the first argument of ‘show’, namely ‘([1, 2, 3] :: [Num a => a])’ In the expression: show ([1, 2, 3] :: [Num a => a]) In an equation for ‘f’: f = show ([1, 2, 3] :: [Num a => a]) + ===================================== testsuite/tests/typecheck/should_fail/T7851.stderr ===================================== @@ -1,7 +1,6 @@ - T7851.hs:5:10: error: [GHC-83865] - • Couldn't match expected type: IO a0 - with actual type: a1 -> IO () + • Couldn't match expected type: IO a1 + with actual type: a0 -> IO () • Probable cause: ‘print’ is applied to too few arguments In a stmt of a 'do' block: print In the expression: @@ -11,3 +10,4 @@ T7851.hs:5:10: error: [GHC-83865] bar = do print print "Hello" + ===================================== testsuite/tests/typecheck/should_fail/T8603.stderr ===================================== @@ -2,9 +2,9 @@ T8603.hs:33:17: error: [GHC-18872] • Couldn't match kind ‘*’ with ‘* -> *’ When matching types m0 :: * -> * - [a2] :: * - Expected: [a2] -> StateT s RV a1 - Actual: t0 m0 (StateT s RV a1) + [a0] :: * + Expected: [a0] -> StateT s RV a2 + Actual: t0 m0 (StateT s RV a2) • The function ‘lift’ is applied to two visible arguments, but its type ‘(Control.Monad.Trans.Class.MonadTrans t, Monad m) => m a -> t m a’ View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c714cafd41c42f19debb2fca76667b5d56ee511...bdaba64233d519efd628c229b97766ef0cf33d4a -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c714cafd41c42f19debb2fca76667b5d56ee511...bdaba64233d519efd628c229b97766ef0cf33d4a You're receiving this email because of your account on gitlab.haskell.org.