Simon Peyton Jones pushed to branch wip/T26004 at Glasgow Haskell Compiler / GHC
Commits:
4a070bbb by Simon Peyton Jones at 2025-05-01T12:21:50+01:00
One more wibble
- - - - -
1 changed file:
- compiler/GHC/Tc/Solver.hs
Changes:
=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -1476,9 +1476,8 @@ decideAndPromoteTyVars top_lvl rhs_tclvl infer_mode name_taus psigs wanted
--------------------------------------------------------------------
-- Step 4 of Note [decideAndPromoteTyVars]
-- Use closeWrtFunDeps to find any other variables that are determined by mono_tvs
- -- ToDo: can_quant, not (no_quant ++ can_quant); #26004
- add_determined tvs = closeWrtFunDeps can_quant tvs
- `delVarSetList` psig_qtvs
+ add_determined tvs preds = closeWrtFunDeps preds tvs
+ `delVarSetList` psig_qtvs
-- Why delVarSetList psig_qtvs?
-- If the user has explicitly asked for quantification, then that
-- request "wins" over the MR.
@@ -1487,8 +1486,8 @@ decideAndPromoteTyVars top_lvl rhs_tclvl infer_mode name_taus psigs wanted
-- (i.e. says "no" to isQuantifiableTv)? That's OK: explanation
-- in Step 2 of Note [Deciding quantification].
- mono_tvs_with_mr_det = add_determined mono_tvs_with_mr
- mono_tvs_without_mr_det = add_determined mono_tvs_without_mr
+ mono_tvs_with_mr_det = add_determined mono_tvs_with_mr post_mr_quant
+ mono_tvs_without_mr_det = add_determined mono_tvs_without_mr can_quant
--------------------------------------------------------------------
-- Step 5 of Note [decideAndPromoteTyVars]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4a070bbb4fd3923da3bdf86b77d3dab…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4a070bbb4fd3923da3bdf86b77d3dab…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Simon Peyton Jones pushed to branch wip/T26004 at Glasgow Haskell Compiler / GHC
Commits:
99fc2a5b by Simon Peyton Jones at 2025-05-01T12:09:28+01:00
Wibbles
- - - - -
3 changed files:
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/InertSet.hs
- compiler/GHC/Tc/Solver/Monad.hs
Changes:
=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -915,21 +915,22 @@ simplifyInfer top_lvl rhs_tclvl infer_mode sigs name_taus wanteds
; let psig_theta = concatMap sig_inst_theta partial_sigs
-- First do full-blown solving
- -- NB: we must gather up all the bindings from doing
- -- this solving; hence (runTcSWithEvBinds ev_binds_var).
- -- And note that since there are nested implications,
- -- calling solveWanteds will side-effect their evidence
- -- bindings, so we can't just revert to the input
- -- constraint.
-
+ -- NB: we must gather up all the bindings from doing this solving; hence
+ -- (runTcSWithEvBinds ev_binds_var). And note that since there are
+ -- nested implications, calling solveWanteds will side-effect their
+ -- evidence bindings, so we can't just revert to the input constraint.
+ --
+ -- See also Note [Inferring principal types]
; ev_binds_var <- TcM.newTcEvBinds
; psig_evs <- newWanteds AnnOrigin psig_theta
; wanted_transformed
<- runTcSWithEvBinds ev_binds_var $
- setTcLevelTcS rhs_tclvl $ -- ToDo: describe subtle placement
+ setTcLevelTcS rhs_tclvl $
solveWanteds (mkSimpleWC psig_evs `andWC` wanteds)
+ -- setLevelTcS: we do setLevel /inside/ the runTcS, so that
+ -- we initialise the InertSet inert_given_eq_lvl as far
+ -- out as possible, maximising oppportunities to unify
-- psig_evs : see Note [Add signature contexts as wanteds]
- -- See Note [Inferring principal types]
-- Find quant_pred_candidates, the predicates that
-- we'll consider quantifying over
=====================================
compiler/GHC/Tc/Solver/InertSet.hs
=====================================
@@ -678,6 +678,23 @@ should update inert_given_eq_lvl?
imply nominal ones. For example, if (G a ~R G b) and G's argument's
role is nominal, then we can deduce a ~N b.
+(TEG6) A subtle point is this: when initialising the solver, giving it
+ an empty InertSet, we must conservatively initialise `inert_given_lvl`
+ to the /current/ TcLevel. This matters when doing let-generalisation.
+ Consider #26004:
+ f w e = case e of
+ T1 -> let y = not w in False -- T1 is a GADT
+ T2 -> True
+ When let-generalising `y`, we will have (w :: alpha[1]) in the type
+ envt; and we are under GADT pattern match. So when we solve the
+ constraints from y's RHS, in simplifyInfer, we must NOT unify
+ alpha[1] := Bool
+ Since we don't know what enclosing equalities there are, we just
+ conservatively assume that there are some.
+
+ This initialisation in done in `runTcSWithEvBinds`, which passes
+ the current TcLevl to `emptyInert`.
+
Historical note: prior to #24938 we also ignored Given equalities that
did not mention an "outer" type variable. But that is wrong, as #24938
showed. Another example is immortalised in test LocalGivenEqs2
=====================================
compiler/GHC/Tc/Solver/Monad.hs
=====================================
@@ -1224,8 +1224,13 @@ runTcSWithEvBinds' :: TcSMode
runTcSWithEvBinds' mode ev_binds_var tcs
= do { unified_var <- TcM.newTcRef 0
; step_count <- TcM.newTcRef 0
+
+ -- Make a fresh, empty inert set
+ -- Subtle point: see (TEG6) in Note [Tracking Given equalities]
+ -- in GHC.Tc.Solver.InertSet
; tc_lvl <- TcM.getTcLevel
; inert_var <- TcM.newTcRef (emptyInert tc_lvl)
+
; wl_var <- TcM.newTcRef emptyWorkList
; unif_lvl_var <- TcM.newTcRef Nothing
; let env = TcSEnv { tcs_ev_binds = ev_binds_var
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/99fc2a5b545cad180859a55109afb58…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/99fc2a5b545cad180859a55109afb58…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

01 May '25
Simon Peyton Jones pushed to branch wip/T26004 at Glasgow Haskell Compiler / GHC
Commits:
731d1d93 by Simon Peyton Jones at 2025-05-01T11:35:23+01:00
Wibbles
- - - - -
6f213c9d by Simon Peyton Jones at 2025-05-01T11:39:37+01:00
Add test for T26004
- - - - -
db5c721f by Simon Peyton Jones at 2025-05-01T11:48:46+01:00
Error messages improve
- - - - -
6 changed files:
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Types/Constraint.hs
- + testsuite/tests/typecheck/should_fail/T26004.hs
- + testsuite/tests/typecheck/should_fail/T26004.stderr
- testsuite/tests/typecheck/should_fail/T7453.stderr
- testsuite/tests/typecheck/should_fail/all.T
Changes:
=====================================
compiler/GHC/Tc/Solver.hs
=====================================
@@ -1430,15 +1430,15 @@ decideAndPromoteTyVars top_lvl rhs_tclvl infer_mode name_taus psigs wanted
-- Step 1 of Note [decideAndPromoteTyVars]
-- Get candidate constraints, decide which we can potentially quantify
- (can_quant_cts, no_quant_cts) = approximateWCX wanted
+ -- The `no_quant_tvs` are free in constraints we can't quantify.
+ (can_quant_cts, no_quant_tvs) = approximateWCX False wanted
can_quant = ctsPreds can_quant_cts
- no_quant = ctsPreds no_quant_cts
can_quant_tvs = tyCoVarsOfTypes can_quant
- no_quant_tvs = tyCoVarsOfTypes no_quant
-- Step 2 of Note [decideAndPromoteTyVars]
-- Apply the monomorphism restriction
(post_mr_quant, mr_no_quant) = applyMR dflags infer_mode can_quant
+ mr_no_quant_tvs = tyCoVarsOfTypes mr_no_quant
-- The co_var_tvs are tvs mentioned in the types of covars or
-- coercion holes. We can't quantify over these covars, so we
@@ -1457,9 +1457,10 @@ decideAndPromoteTyVars top_lvl rhs_tclvl infer_mode name_taus psigs wanted
-- Step 3 of Note [decideAndPromoteTyVars], (a-c)
-- Identify mono_tvs: the type variables that we must not quantify over
+ -- At top level we are much less keen to create mono tyvars, to avoid
+ -- spooky action at a distance.
mono_tvs_without_mr
--- This does not work well (#26004)
--- | is_top_level = outer_tvs
+ | is_top_level = outer_tvs -- See (DP2)
| otherwise = outer_tvs -- (a)
`unionVarSet` no_quant_tvs -- (b)
`unionVarSet` co_var_tvs -- (c)
@@ -1469,7 +1470,7 @@ decideAndPromoteTyVars top_lvl rhs_tclvl infer_mode name_taus psigs wanted
= -- Even at top level, we don't quantify over type variables
-- mentioned in constraints that the MR tells us not to quantify
-- See Note [decideAndPromoteTyVars] (DP2)
- mono_tvs_without_mr `unionVarSet` tyCoVarsOfTypes mr_no_quant
+ mono_tvs_without_mr `unionVarSet` mr_no_quant_tvs
--------------------------------------------------------------------
-- Step 4 of Note [decideAndPromoteTyVars]
@@ -1523,7 +1524,7 @@ decideAndPromoteTyVars top_lvl rhs_tclvl infer_mode name_taus psigs wanted
, text "newly_mono_tvs =" <+> ppr newly_mono_tvs
, text "can_quant =" <+> ppr can_quant
, text "post_mr_quant =" <+> ppr post_mr_quant
- , text "no_quant =" <+> ppr no_quant
+ , text "no_quant_tvs =" <+> ppr no_quant_tvs
, text "mr_no_quant =" <+> ppr mr_no_quant
, text "final_quant =" <+> ppr final_quant
, text "co_vars =" <+> ppr co_vars ]
@@ -1648,9 +1649,22 @@ Wrinkles
promote type variables. But for bindings affected by the MR we have no choice
but to promote.
+ An example is in #26004.
+ f w e = case e of
+ T1 -> let y = not w in False
+ T2 -> True
+ When generalising `f` we have a constraint
+ forall. (a ~ Bool) => alpha ~ Bool
+ where our provisional type for `f` is `f :: T alpha -> blah`.
+ In a /nested/ setting, we might simply not-generalise `f`, hoping to learn
+ about `alpha` from f's call sites (test T5266b is an example). But at top
+ level, to avoid spooky action at a distance.
+
Note [The top-level Any principle]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Key principle: we never want to show the programmer a type with `Any` in it.
+Key principles:
+ * we never want to show the programmer a type with `Any` in it.
+ * avoid "spooky action at a distance" and silent defaulting
Most /top level/ bindings have a type signature, so none of this arises. But
where a top-level binding lacks a signature, we don't want to infer a type like
@@ -1659,11 +1673,18 @@ and then subsequently default alpha[0]:=Any. Exposing `Any` to the user is bad
bad bad. Better to report an error, which is what may well happen if we
quantify over alpha instead.
+Moreover,
+ * If (elsewhere in this module) we add a call to `f`, say (f True), then
+ `f` will get the type `Bool -> Int`
+ * If we add /another/ call, say (f 'x'), we will then get a type error.
+ * If we have no calls, the final exported type of `f` may get set by
+ defaulting, and might not be principal (#26004).
+
For /nested/ bindings, a monomorphic type like `f :: alpha[0] -> Int` is fine,
because we can see all the call sites of `f`, and they will probably fix
`alpha`. In contrast, we can't see all of (or perhaps any of) the calls of
top-level (exported) functions, reducing the worries about "spooky action at a
-distance".
+distance". This also moves in the direction of `MonoLocalBinds`, which we like.
Note [Do not quantify over constraints that determine a variable]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
=====================================
compiler/GHC/Tc/Types/Constraint.hs
=====================================
@@ -1743,24 +1743,21 @@ will be able to report a more informative error:
************************************************************************
-}
-type ApproxWC = ( Bag Ct -- Free quantifiable constraints
- , Bag Ct ) -- Free non-quantifiable constraints
- -- due to shape, or enclosing equality
+type ApproxWC = ( Bag Ct -- Free quantifiable constraints
+ , TcTyCoVarSet ) -- Free vars of non-quantifiable constraints
+ -- due to shape, or enclosing equality
approximateWC :: Bool -> WantedConstraints -> Bag Ct
approximateWC include_non_quantifiable cts
- | include_non_quantifiable = quant `unionBags` no_quant
- | otherwise = quant
- where
- (quant, no_quant) = approximateWCX cts
+ = fst (approximateWCX include_non_quantifiable cts)
-approximateWCX :: WantedConstraints -> ApproxWC
+approximateWCX :: Bool -> WantedConstraints -> ApproxWC
-- The "X" means "extended";
-- we return both quantifiable and non-quantifiable constraints
-- See Note [ApproximateWC]
-- See Note [floatKindEqualities vs approximateWC]
-approximateWCX wc
- = float_wc False emptyVarSet wc (emptyBag, emptyBag)
+approximateWCX include_non_quantifiable wc
+ = float_wc False emptyVarSet wc (emptyBag, emptyVarSet)
where
float_wc :: Bool -- True <=> there are enclosing equalities
-> TcTyCoVarSet -- Enclosing skolem binders
@@ -1786,17 +1783,23 @@ approximateWCX wc
-- There can be (insoluble) Given constraints in wc_simple,
-- there so that we get error reports for unreachable code
-- See `given_insols` in GHC.Tc.Solver.Solve.solveImplication
- | insolubleCt ct = acc
- | tyCoVarsOfCt ct `intersectsVarSet` skol_tvs = acc
- | otherwise
- = case classifyPredType (ctPred ct) of
+ | insolubleCt ct = acc
+ | pred_tvs `intersectsVarSet` skol_tvs = acc
+ | include_non_quantifiable = add_to_quant
+ | is_quantifiable encl_eqs (ctPred ct) = add_to_quant
+ | otherwise = add_to_no_quant
+ where
+ pred = ctPred ct
+ pred_tvs = tyCoVarsOfType pred
+ add_to_quant = (ct `consBag` quant, no_quant)
+ add_to_no_quant = (quant, no_quant `unionVarSet` pred_tvs)
+
+ is_quantifiable encl_eqs pred
+ = case classifyPredType pred of
-- See the classification in Note [ApproximateWC]
EqPred eq_rel ty1 ty2
- | encl_eqs -> acc
- | quantify_equality eq_rel ty1 ty2 -> add_to_quant
- | otherwise -> add_to_no_quant
- -- encl_eqs: See Wrinkle (W1)
- -- ToDo: explain acc
+ | encl_eqs -> False -- encl_eqs: See Wrinkle (W1)
+ | otherwise -> quantify_equality eq_rel ty1 ty2
ClassPred cls tys
| Just {} <- isCallStackPred cls tys
@@ -1804,17 +1807,14 @@ approximateWCX wc
-- the constraints bubble up to be solved from the outer
-- context, or be defaulted when we reach the top-level.
-- See Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence
- -> add_to_no_quant
+ -> False
| otherwise
- -> add_to_quant -- See Wrinkle (W2)
+ -> True -- See Wrinkle (W2)
- IrredPred {} -> add_to_quant -- See Wrinkle (W2)
+ IrredPred {} -> True -- See Wrinkle (W2)
- ForAllPred {} -> add_to_no_quant -- Never quantify these
- where
- add_to_quant = (ct `consBag` quant, no_quant)
- add_to_no_quant = (quant, ct `consBag` no_quant)
+ ForAllPred {} -> False -- Never quantify these
-- See Note [Quantifying over equality constraints]
quantify_equality NomEq ty1 ty2 = quant_fun ty1 || quant_fun ty2
=====================================
testsuite/tests/typecheck/should_fail/T26004.hs
=====================================
@@ -0,0 +1,14 @@
+{-# LANGUAGE GADTs #-}
+{-# LANGUAGE NoMonoLocalBinds #-}
+
+module T26004 where
+
+data T a where
+ T1 :: T Bool
+ T2 :: T a
+
+-- This funcion should be rejected:
+-- we should not infer a non-principal type for `f`
+f w e = case e of
+ T1 -> let y = not w in False
+ T2 -> True
=====================================
testsuite/tests/typecheck/should_fail/T26004.stderr
=====================================
@@ -0,0 +1,17 @@
+
+T26004.hs:13:21: error: [GHC-25897]
+ • Could not deduce ‘p ~ Bool’
+ from the context: a ~ Bool
+ bound by a pattern with constructor: T1 :: T Bool,
+ in a case alternative
+ at T26004.hs:13:3-4
+ ‘p’ is a rigid type variable bound by
+ the inferred type of f :: p -> T a -> Bool
+ at T26004.hs:(12,1)-(14,12)
+ • In the first argument of ‘not’, namely ‘w’
+ In the expression: not w
+ In an equation for ‘y’: y = not w
+ • Relevant bindings include
+ w :: p (bound at T26004.hs:12:3)
+ f :: p -> T a -> Bool (bound at T26004.hs:12:1)
+ Suggested fix: Consider giving ‘f’ a type signature
=====================================
testsuite/tests/typecheck/should_fail/T7453.stderr
=====================================
@@ -1,8 +1,5 @@
-
-T7453.hs:9:15: error: [GHC-25897]
- • Couldn't match type ‘t’ with ‘p’
- Expected: Id t
- Actual: Id p
+T7453.hs:10:30: error: [GHC-25897]
+ • Couldn't match expected type ‘t’ with actual type ‘p’
‘t’ is a rigid type variable bound by
the type signature for:
z :: forall t. Id t
@@ -10,29 +7,17 @@ T7453.hs:9:15: error: [GHC-25897]
‘p’ is a rigid type variable bound by
the inferred type of cast1 :: p -> a
at T7453.hs:(7,1)-(10,30)
- • In the expression: aux
- In an equation for ‘z’:
- z = aux
- where
- aux = Id v
- In an equation for ‘cast1’:
- cast1 v
- = runId z
- where
- z :: Id t
- z = aux
- where
- aux = Id v
+ • In the first argument of ‘Id’, namely ‘v’
+ In the expression: Id v
+ In an equation for ‘aux’: aux = Id v
• Relevant bindings include
- aux :: Id p (bound at T7453.hs:10:21)
+ aux :: Id t (bound at T7453.hs:10:21)
z :: Id t (bound at T7453.hs:9:11)
v :: p (bound at T7453.hs:7:7)
cast1 :: p -> a (bound at T7453.hs:7:1)
-T7453.hs:15:15: error: [GHC-25897]
- • Couldn't match type ‘t1’ with ‘p’
- Expected: () -> t1
- Actual: () -> p
+T7453.hs:16:33: error: [GHC-25897]
+ • Couldn't match expected type ‘t1’ with actual type ‘p’
‘t1’ is a rigid type variable bound by
the type signature for:
z :: forall t1. () -> t1
@@ -40,21 +25,11 @@ T7453.hs:15:15: error: [GHC-25897]
‘p’ is a rigid type variable bound by
the inferred type of cast2 :: p -> t
at T7453.hs:(13,1)-(16,33)
- • In the expression: aux
- In an equation for ‘z’:
- z = aux
- where
- aux = const v
- In an equation for ‘cast2’:
- cast2 v
- = z ()
- where
- z :: () -> t
- z = aux
- where
- aux = const v
+ • In the first argument of ‘const’, namely ‘v’
+ In the expression: const v
+ In an equation for ‘aux’: aux = const v
• Relevant bindings include
- aux :: forall {b}. b -> p (bound at T7453.hs:16:21)
+ aux :: b -> t1 (bound at T7453.hs:16:21)
z :: () -> t1 (bound at T7453.hs:15:11)
v :: p (bound at T7453.hs:13:7)
cast2 :: p -> t (bound at T7453.hs:13:1)
@@ -86,3 +61,4 @@ T7453.hs:21:15: error: [GHC-25897]
z :: t1 (bound at T7453.hs:21:11)
v :: p (bound at T7453.hs:19:7)
cast3 :: p -> t (bound at T7453.hs:19:1)
+
=====================================
testsuite/tests/typecheck/should_fail/all.T
=====================================
@@ -735,3 +735,4 @@ test('T24938', normal, compile_fail, [''])
test('T25325', normal, compile_fail, [''])
test('T25004', normal, compile_fail, [''])
test('T25004k', normal, compile_fail, [''])
+test('T26004', normal, compile_fail, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ca6cd646c542ede632511448546b2c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ca6cd646c542ede632511448546b2c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Zubin pushed new branch wip/9.10.2-final at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/9.10.2-final
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: get-win32-tarballs.py: List tarball files to be downloaded if we cannot find them
by Marge Bot (@marge-bot) 01 May '25
by Marge Bot (@marge-bot) 01 May '25
01 May '25
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
aba2a4a5 by Zubin Duggal at 2025-04-30T06:35:59-04:00
get-win32-tarballs.py: List tarball files to be downloaded if we cannot find them
Fixes #25929
- - - - -
d99a617b by Ben Gamari at 2025-04-30T06:36:40-04:00
Move Data ModuleName instance to Language.Haskell.Syntax.Module.Name
Fixes #25968.
- - - - -
b24e95f1 by Serge S. Gulin at 2025-05-01T00:01:53+03:00
Support for ARM64 Windows (LLVM-enabled) (fixes #24603)
submodule
Co-authored-by: Cheng Shao <terrorjack(a)type.dance>
Co-authored-by: Dmitrii Egorov <egorov.d.i(a)icloud.com>
Co-authored-by: Andrei Borzenkov <root(a)sandwitch.dev>
- - - - -
55a09eb4 by Javran Cheng at 2025-05-01T04:31:00-04:00
Suppress unused do-binding if discarded variable is Any or ZonkAny.
Consider example (#25895):
> do { forever (return ()); blah }
where `forever :: forall a b. IO a -> IO b`.
Nothing constrains `b`, so it will be instantiates with `Any` or
`ZonkAny`.
But we certainly don't want to complain about a discarded do-binding.
Fixes #25895
- - - - -
43 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/hello.hs
- .gitlab/jobs.yaml
- compiler/CodeGen.Platform.h
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/Platform/Regs.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Unit/Types.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/BinaryDist.hs
- libraries/Cabal
- libraries/Win32
- libraries/base/src/System/CPUTime/Windows.hsc
- libraries/base/tests/perf/encodingAllocations.hs
- libraries/directory
- libraries/ghc-internal/jsbits/errno.js
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/haskeline
- libraries/process
- libraries/unix
- llvm-targets
- m4/fp_cc_supports_target.m4
- m4/fp_setup_windows_toolchain.m4
- m4/fptools_set_platform_vars.m4
- m4/ghc_tables_next_to_code.m4
- rts/StgCRun.c
- rts/linker/PEi386.c
- rts/win32/veh_excn.c
- testsuite/tests/ghc-api/fixed-nodes/all.T
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/printer/T17697.stderr
- utils/ghc-toolchain/exe/Main.hs
- utils/hsc2hs
- utils/llvm-targets/gen-data-layout.sh
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/319b4d1024fa03a117e76e4a5a3cb8…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/319b4d1024fa03a117e76e4a5a3cb8…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Ben Gamari pushed new branch wip/T25943 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/T25943
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/T24603] 3 commits: get-win32-tarballs.py: List tarball files to be downloaded if we cannot find them
by Serge S. Gulin (@gulin.serge) 30 Apr '25
by Serge S. Gulin (@gulin.serge) 30 Apr '25
30 Apr '25
Serge S. Gulin pushed to branch wip/T24603 at Glasgow Haskell Compiler / GHC
Commits:
aba2a4a5 by Zubin Duggal at 2025-04-30T06:35:59-04:00
get-win32-tarballs.py: List tarball files to be downloaded if we cannot find them
Fixes #25929
- - - - -
d99a617b by Ben Gamari at 2025-04-30T06:36:40-04:00
Move Data ModuleName instance to Language.Haskell.Syntax.Module.Name
Fixes #25968.
- - - - -
b24e95f1 by Serge S. Gulin at 2025-05-01T00:01:53+03:00
Support for ARM64 Windows (LLVM-enabled) (fixes #24603)
submodule
Co-authored-by: Cheng Shao <terrorjack(a)type.dance>
Co-authored-by: Dmitrii Egorov <egorov.d.i(a)icloud.com>
Co-authored-by: Andrei Borzenkov <root(a)sandwitch.dev>
- - - - -
39 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/hello.hs
- .gitlab/jobs.yaml
- compiler/CodeGen.Platform.h
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Platform/Regs.hs
- compiler/GHC/Unit/Types.hs
- compiler/Language/Haskell/Syntax/Module/Name.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/BinaryDist.hs
- libraries/Cabal
- libraries/Win32
- libraries/base/src/System/CPUTime/Windows.hsc
- libraries/base/tests/perf/encodingAllocations.hs
- libraries/directory
- libraries/ghc-internal/jsbits/errno.js
- libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs
- libraries/haskeline
- libraries/process
- libraries/unix
- llvm-targets
- m4/fp_cc_supports_target.m4
- m4/fp_setup_windows_toolchain.m4
- m4/fptools_set_platform_vars.m4
- m4/ghc_tables_next_to_code.m4
- rts/StgCRun.c
- rts/linker/PEi386.c
- rts/win32/veh_excn.c
- testsuite/tests/ghc-api/fixed-nodes/all.T
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- utils/ghc-toolchain/exe/Main.hs
- utils/hsc2hs
- utils/llvm-targets/gen-data-layout.sh
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/93fca693ad28752cd4efb3ba88746c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/93fca693ad28752cd4efb3ba88746c…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/fendor/ghci-multiple-home-units] Make GHCi commands compatible with multiple home units
by Hannes Siebenhandl (@fendor) 30 Apr '25
by Hannes Siebenhandl (@fendor) 30 Apr '25
30 Apr '25
Hannes Siebenhandl pushed to branch wip/fendor/ghci-multiple-home-units at Glasgow Haskell Compiler / GHC
Commits:
641ecf7b by fendor at 2025-04-30T18:20:37+02:00
Make GHCi commands compatible with multiple home units
FIXME: proper commit message
- - - - -
38 changed files:
- compiler/GHC.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Rename/Unbound.hs
- compiler/GHC/Runtime/Context.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Types/Name/Ppr.hs
- compiler/GHC/Unit/Env.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Types.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- ghc/GHCi/UI/Monad.hs
- ghc/Main.hs
- testsuite/tests/driver/fat-iface/fat014.stdout
- testsuite/tests/driver/multipleHomeUnits/multiGHCi.stderr
- testsuite/tests/ghc-api/T6145.hs
- testsuite/tests/ghc-api/annotations-literals/literals.hs
- testsuite/tests/ghc-api/annotations-literals/parsed.hs
- testsuite/tests/ghc-api/apirecomp001/myghc.hs
- testsuite/tests/ghc-api/fixed-nodes/T1.hs
- testsuite/tests/ghci/linking/dyn/T3372.hs
- testsuite/tests/ghci/prog018/prog018.stdout
- testsuite/tests/ghci/scripts/T13869.stdout
- testsuite/tests/ghci/scripts/T13997.stdout
- testsuite/tests/ghci/scripts/T17669.stdout
- testsuite/tests/ghci/scripts/T18330.stdout
- testsuite/tests/ghci/scripts/T1914.stdout
- testsuite/tests/ghci/scripts/T20217.stdout
- testsuite/tests/ghci/scripts/T20587.stdout
- testsuite/tests/ghci/scripts/T6105.stdout
- testsuite/tests/ghci/scripts/T8042.stdout
- testsuite/tests/ghci/scripts/T8042recomp.stdout
- testsuite/tests/ghci/scripts/ghci024.stdout
- testsuite/tests/ghci/should_run/TopEnvIface.stdout
- testsuite/tests/quasiquotation/T7918.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/641ecf7b709f3f85a410821739ffeaf…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/641ecf7b709f3f85a410821739ffeaf…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/interpolated-strings] Prototype implicit-no-builder + QualifiedLiterals
by Brandon Chinn (@brandonchinn178) 30 Apr '25
by Brandon Chinn (@brandonchinn178) 30 Apr '25
30 Apr '25
Brandon Chinn pushed to branch wip/interpolated-strings at Glasgow Haskell Compiler / GHC
Commits:
d114d7dd by Brandon Chinn at 2025-04-30T08:45:58-07:00
Prototype implicit-no-builder + QualifiedLiterals
- - - - -
29 changed files:
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/String.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-experimental/src/Data/String/Interpolate/Experimental.hs
- libraries/ghc-internal/src/GHC/Internal/Data/String/Interpolate.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- testsuite/tests/driver/T4437.hs
- testsuite/tests/parser/should_run/StringInterpolationOverloaded.hs
- + testsuite/tests/parser/should_run/StringInterpolationQualified.hs
- + testsuite/tests/parser/should_run/StringInterpolationQualified.stdout
- + testsuite/tests/parser/should_run/StringInterpolationQualified_SQL.hs
- testsuite/tests/parser/should_run/all.T
Changes:
=====================================
compiler/GHC/Builtin/Names.hs
=====================================
@@ -286,7 +286,7 @@ basicKnownKeyNames
fromStringName,
-- Interpolated strings
- fromBuilderName, toBuilderName, interpolateName,
+ interpolateName,
-- Enum stuff
enumFromName, enumFromThenName,
@@ -1123,9 +1123,7 @@ minusName = varQual gHC_INTERNAL_NUM (fsLit "-") minusClassOpK
negateName = varQual gHC_INTERNAL_NUM (fsLit "negate") negateClassOpKey
-- Module GHC.Internal.Data.String.Interpolate
-toBuilderName, fromBuilderName, interpolateName :: Name
-toBuilderName = varQual gHC_INTERNAL_DATA_STRING_INTERPOLATE (fsLit "toBuilder") toBuilderKey
-fromBuilderName = varQual gHC_INTERNAL_DATA_STRING_INTERPOLATE (fsLit "fromBuilder") fromBuilderKey
+interpolateName :: Name
interpolateName = varQual gHC_INTERNAL_DATA_STRING_INTERPOLATE (fsLit "interpolate") interpolateKey
---------------------------------
@@ -2502,9 +2500,7 @@ proxyHashKey :: Unique
proxyHashKey = mkPreludeMiscIdUnique 502
-- String interpolation
-toBuilderKey, fromBuilderKey, interpolateKey :: Unique
-toBuilderKey = mkPreludeMiscIdUnique 574
-fromBuilderKey = mkPreludeMiscIdUnique 575
+interpolateKey :: Unique
interpolateKey = mkPreludeMiscIdUnique 576
---------------- Template Haskell -------------------
=====================================
compiler/GHC/Driver/Flags.hs
=====================================
@@ -260,6 +260,7 @@ extensionName = \case
LangExt.ListTuplePuns -> "ListTuplePuns"
LangExt.MultilineStrings -> "MultilineStrings"
LangExt.StringInterpolation -> "StringInterpolation"
+ LangExt.QualifiedLiterals -> "QualifiedLiterals"
LangExt.ExplicitLevelImports -> "ExplicitLevelImports"
LangExt.ImplicitStagePersistence -> "ImplicitStagePersistence"
=====================================
compiler/GHC/Hs/Expr.hs
=====================================
@@ -868,8 +868,8 @@ ppr_expr (HsOverLabel s l) = case ghcPass @p of
ppr_expr (HsLit _ lit) = ppr lit
ppr_expr (HsOverLit _ lit) = ppr lit
-ppr_expr (HsInterString _ strType parts) =
- char 's' <> delim <> hcat (map pprInterPart parts) <> delim
+ppr_expr (HsInterString _ mQualMod strType parts) =
+ prefix <> delim <> hcat (map pprInterPart parts) <> delim
where
pprInterPart = \case
HsInterStringRaw st s ->
@@ -880,6 +880,11 @@ ppr_expr (HsInterString _ strType parts) =
(HsStringTypeMulti, NoSourceText) -> pprHsStringMulti' (unpackFS s)
HsInterStringExpr _ expr -> text "${" <> ppr_lexpr expr <> text "}"
+ prefix =
+ case mQualMod of
+ Nothing -> char 's'
+ Just qualMod -> ppr qualMod <> char '.'
+
delim =
case strType of
HsStringTypeSingle -> char '"'
=====================================
compiler/GHC/Hs/Syn/Type.hs
=====================================
@@ -106,7 +106,7 @@ hsExprType (HsOverLabel v _) = dataConCantHappen v
hsExprType (HsIPVar v _) = dataConCantHappen v
hsExprType (HsOverLit _ lit) = overLitType lit
hsExprType (HsLit _ lit) = hsLitType lit
-hsExprType (HsInterString _ _ _) = stringTy -- TODO: handle OverloadedStrings
+hsExprType (HsInterString _ _ _ _) = stringTy -- TODO: handle OverloadedStrings + QualifiedLiterals
hsExprType (HsLam _ _ (MG { mg_ext = match_group })) = matchGroupTcType match_group
hsExprType (HsApp _ f _) = funResultTy $ lhsExprType f
hsExprType (HsAppType x f _) = piResultTy (lhsExprType f) x
=====================================
compiler/GHC/HsToCore/Expr.hs
=====================================
@@ -554,7 +554,7 @@ dsExpr (HsOverLabel x _) = dataConCantHappen x
dsExpr (OpApp x _ _ _) = dataConCantHappen x
dsExpr (SectionL x _ _) = dataConCantHappen x
dsExpr (SectionR x _ _) = dataConCantHappen x
-dsExpr (HsInterString x _ _) = dataConCantHappen x
+dsExpr (HsInterString x _ _ _) = dataConCantHappen x
{- *********************************************************************
=====================================
compiler/GHC/HsToCore/Quote.hs
=====================================
@@ -1576,11 +1576,11 @@ repE (HsOverLabel _ s) = repOverLabel s
-- HsOverlit can definitely occur
repE (HsOverLit _ l) = do { a <- repOverloadedLiteral l; repLit a }
repE (HsLit _ l) = do { a <- repLiteral l; repLit a }
-repE (HsInterString _ _ parts) = do
+repE (HsInterString _ mQualMod _ parts) = do
parts' <- forM parts $ \case
HsInterStringRaw _ s -> repInterStringRaw =<< coreStringLit s
HsInterStringExpr _ e -> repInterStringExp =<< repLE e
- repInterString =<< coreListM interStringPartName parts'
+ repInterString mQualMod =<< coreListM interStringPartName parts'
repE (HsLam _ LamSingle (MG { mg_alts = L _ [m] })) = repLambda m
repE e@(HsLam _ LamSingle (MG { mg_alts = L _ _ })) = pprPanic "repE: HsLam with multiple alternatives" (ppr e)
repE (HsLam _ LamCase (MG { mg_alts = L _ ms }))
@@ -2565,16 +2565,17 @@ repMDoE = repDoBlock mdoEName
repDoBlock :: Name -> Maybe ModuleName -> Core [(M TH.Stmt)] -> MetaM (Core (M TH.Exp))
repDoBlock doName maybeModName (MkC ss) = do
- MkC coreModName <- coreModNameM
- rep2 doName [coreModName, ss]
- where
- coreModNameM :: MetaM (Core (Maybe TH.ModName))
- coreModNameM = case maybeModName of
- Just m -> do
- MkC s <- coreStringLit (moduleNameFS m)
- mName <- rep2_nw mkModNameName [s]
- coreJust modNameTyConName mName
- _ -> coreNothing modNameTyConName
+ MkC mCoreModName <- repMaybeModName maybeModName
+ rep2 doName [mCoreModName, ss]
+
+repMaybeModName :: Maybe ModuleName -> MetaM (Core (Maybe TH.ModName))
+repMaybeModName = \case
+ Just m -> do
+ MkC s <- coreStringLit (moduleNameFS m)
+ mName <- rep2_nw mkModNameName [s]
+ coreJust modNameTyConName mName
+ Nothing ->
+ coreNothing modNameTyConName
repComp :: Core [(M TH.Stmt)] -> MetaM (Core (M TH.Exp))
repComp (MkC ss) = rep2 compEName [ss]
@@ -2663,8 +2664,10 @@ repClause :: Core [(M TH.Pat)] -> Core (M TH.Body) -> Core [(M TH.Dec)] -> MetaM
repClause (MkC ps) (MkC bod) (MkC ds) = rep2 clauseName [ps, bod, ds]
-------------- Interpolated strings -----------------------------
-repInterString :: Core [M TH.InterStringPart] -> MetaM (Core (M TH.Exp))
-repInterString (MkC parts) = rep2 interStringEName [parts]
+repInterString :: Maybe ModuleName -> Core [M TH.InterStringPart] -> MetaM (Core (M TH.Exp))
+repInterString mQualMod (MkC parts) = do
+ MkC mCoreModName <- repMaybeModName mQualMod
+ rep2 interStringEName [mCoreModName, parts]
repInterStringRaw :: Core String -> MetaM (Core (M TH.InterStringPart))
repInterStringRaw (MkC s) = rep2 interStringRawName [s]
=====================================
compiler/GHC/HsToCore/Ticks.hs
=====================================
@@ -477,11 +477,12 @@ addTickHsExpr e@(HsIPVar {}) = return e
addTickHsExpr e@(HsOverLit {}) = return e
addTickHsExpr e@(HsOverLabel{}) = return e
addTickHsExpr e@(HsLit {}) = return e
-addTickHsExpr (HsInterString x ty parts) = do
+addTickHsExpr (HsInterString x mQualMod ty parts) = do
+ -- TODO: should we add ticks for qualified literals?
parts' <- forM parts $ \case
part@(HsInterStringRaw {}) -> return part
HsInterStringExpr x e -> HsInterStringExpr x <$> addTickLHsExpr e
- return $ HsInterString x ty parts'
+ return $ HsInterString x mQualMod ty parts'
addTickHsExpr e@(HsEmbTy {}) = return e
addTickHsExpr e@(HsHole {}) = return e
addTickHsExpr e@(HsQual {}) = return e
=====================================
compiler/GHC/Iface/Ext/Ast.hs
=====================================
@@ -1198,7 +1198,7 @@ instance HiePass p => ToHie (LocatedA (HsExpr (GhcPass p))) where
[ toHie (L mspan o)
]
HsLit _ _ -> []
- HsInterString _ _ parts ->
+ HsInterString _ _ _ parts ->
[ toHie expr
| HsInterStringExpr _ expr <- parts
]
=====================================
compiler/GHC/Parser.y
=====================================
@@ -736,9 +736,9 @@ are the most common patterns, rewritten as regular expressions for clarity:
CHAR { L _ (ITchar _ _) }
STRING { L _ (ITstring _ StringTypeSingle _) }
STRING_MULTI { L _ (ITstring _ StringTypeMulti _) }
- STRING_INTER_BEGIN { L _ (ITstringInterBegin StringTypeSingle) }
+ STRING_INTER_BEGIN { L _ (ITstringInterBegin _ StringTypeSingle) }
STRING_INTER_END { L _ (ITstringInterEnd StringTypeSingle) }
- STRING_INTER_MULTI_BEGIN { L _ (ITstringInterBegin StringTypeMulti) }
+ STRING_INTER_MULTI_BEGIN { L _ (ITstringInterBegin _ StringTypeMulti) }
STRING_INTER_MULTI_END { L _ (ITstringInterEnd StringTypeMulti) }
STRING_INTER_RAW { L _ (ITstringInterRaw _ _) }
STRING_INTER_EXP_OPEN { L _ ITstringInterExpOpen }
@@ -4365,7 +4365,7 @@ processStringInter ::
processStringInter strType tokBegin parts tokEnd = do
parts' <- mapM mkInterStringPartPV $ processRawLexedStrings parts
ams1 (L (comb2 tokBegin tokEnd) ()) $
- HsInterString noExtField strType parts'
+ HsInterString noExtField mQualMod strType parts'
where
processRawLexedStrings ::
[Either (SourceText, RawLexedString) ECP] ->
@@ -4379,6 +4379,10 @@ processStringInter strType tokBegin parts tokEnd = do
Left (src, s) -> pure $ HsInterStringRaw src (fsLit s)
Right (ECP e) -> HsInterStringExpr noExtField <$> runPV e
+ mQualMod =
+ let L _ (ITstringInterBegin mMod _) = tokBegin
+ in mkModuleNameFS <$> mMod
+
-- Utilities for combining source spans
comb2 :: (HasLoc a, HasLoc b) => a -> b -> SrcSpan
comb2 !a !b = combineHasLocs a b
=====================================
compiler/GHC/Parser/Lexer.x
=====================================
@@ -632,6 +632,7 @@ $unigraphic / { isSmartQuote } { smart_quote_error }
-- See Note [Parsing interpolated strings] and Note [Lexing interpolated strings]
<0,string_inter> {
s \" / { ifExtension StringInterpolationBit } { string_inter_begin }
+ @qual \" / { ifExtension QualifiedLiteralsBit } { string_inter_begin }
-- TODO(bchinn): interpolated multiline strings
}
@@ -930,7 +931,9 @@ data Token
| ITstring SourceText StringType FastString -- Note [Literal source text] in "GHC.Types.SourceText"
-- See Note [Parsing interpolated strings]
- | ITstringInterBegin StringType
+ | ITstringInterBegin
+ (Maybe FastString) -- Module name, if using QualifiedLiterals
+ StringType -- Single-line or multiline interpolated string?
| ITstringInterRaw SourceText RawLexedString -- Note [Literal source text] in "GHC.Types.SourceText"
| ITstringInterExpOpen
| ITstringInterExpClose
@@ -2196,9 +2199,14 @@ tok_string span buf len _buf2 = do
endsInHash = currentChar (offsetBytes (len - 1) buf) == '#'
string_inter_begin :: Action
-string_inter_begin span _ _ _ = do
+string_inter_begin span buf len _ = do
pushLexState string_inter_content
- pure $ L span (ITstringInterBegin StringTypeSingle)
+ let mQualMod
+ | len == 2 = Nothing
+ | otherwise =
+ let (qualMod, _) = splitQualName buf len False
+ in Just qualMod
+ pure $ L span (ITstringInterBegin mQualMod StringTypeSingle)
string_inter_content_action :: Action
string_inter_content_action span_init buf_init _ _ = go $ AI (psSpanStart span_init) buf_init
@@ -2835,6 +2843,7 @@ data ExtBits
| RequiredTypeArgumentsBit
| MultilineStringsBit
| StringInterpolationBit
+ | QualifiedLiteralsBit
| LevelImportsBit
-- Flags that are updated once parsing starts
@@ -2920,6 +2929,7 @@ mkParserOpts extensionFlags diag_opts
.|. RequiredTypeArgumentsBit `xoptBit` LangExt.RequiredTypeArguments
.|. MultilineStringsBit `xoptBit` LangExt.MultilineStrings
.|. StringInterpolationBit `xoptBit` LangExt.StringInterpolation
+ .|. QualifiedLiteralsBit `xoptBit` LangExt.QualifiedLiterals
.|. LevelImportsBit `xoptBit` LangExt.ExplicitLevelImports
optBits =
HaddockBit `setBitIf` isHaddock
=====================================
compiler/GHC/Parser/String.hs
=====================================
@@ -339,19 +339,19 @@ Interpolated strings are parsed in the following manner:
and outputs the following tokens:
- [ ITstringInterBegin src StringTypeSingle
+ [ ITstringInterBegin Nothing StringTypeSingle
, ITstringInterRaw src "Hello "
- , ITstringInterExpOpen src
+ , ITstringInterExpOpen
, ITqvarid ("Text.toUpper", "name")
, ITvarid "name"
- , ITstringInterExpClose src
+ , ITstringInterExpClose
, ITstringInterRaw src "!"
- , ITstringInterEnd src StringTypeSingle
+ , ITstringInterEnd StringTypeSingle
]
2. The parser will then parse the tokens into the following HsExpr:
- HsInterString ext
+ HsInterString ext Nothing StringTypeSingle
[ HsInterStringRaw ext "Hello "
, HsInterStringExp ext $
HsApp ext
=====================================
compiler/GHC/Rename/Expr.hs
=====================================
@@ -385,9 +385,9 @@ rnExpr (HsLit x lit)
rnExpr (HsOverLit x lit)
= rnOverLit x lit
-rnExpr (HsInterString _ strType parts) = do
+rnExpr (HsInterString _ mQualMod strType parts) = do
(parts', fvs1) <- unzip <$> mapM rnInterStringPart parts
- (expr, fvs2) <- rewriteInterString strType parts'
+ (expr, fvs2) <- rewriteInterString mQualMod strType parts'
pure (expr, plusFVs fvs1 `plusFV` fvs2)
where
rnInterStringPart = \case
=====================================
compiler/GHC/Rename/String.hs
=====================================
@@ -1,4 +1,6 @@
{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE MultiWayIf #-}
+{-# LANGUAGE RecordWildCards #-}
module GHC.Rename.String (
rewriteInterString,
@@ -7,24 +9,24 @@ module GHC.Rename.String (
import GHC.Prelude
import GHC.Builtin.Names (
- fromBuilderName,
interpolateName,
- mappendName,
- memptyName,
- toBuilderName,
+ mconcatName,
)
import GHC.Builtin.Types (stringTyConName)
import GHC.Data.FastString (fsLit, unpackFS)
import GHC.Hs
import qualified GHC.LanguageExtensions as LangExt
+import GHC.Rename.Env (lookupOccRn)
import GHC.Rename.Pat (rnOverLit)
+import GHC.Tc.Errors.Types (WhatLooking (WL_None))
import GHC.Tc.Utils.Monad
+import GHC.Types.Name (Name)
+import GHC.Types.Name.Occurrence (mkVarOcc)
+import GHC.Types.Name.Reader (mkRdrQual)
import GHC.Types.Name.Set (FreeVars, emptyFVs, plusFVs)
import GHC.Types.SourceText (SourceText (..))
import GHC.Types.SrcLoc (unLoc)
-import qualified Data.List.NonEmpty as NE
-
{- Note [Desugaring interpolated strings]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -34,7 +36,7 @@ Cross-references:
Interpolated strings are represented with the following HsExpr tree:
- HsInterString ext
+ HsInterString ext mQualMod strType
[ HsInterStringRaw ext "Hello "
, HsInterStringExp ext $
HsApp ext
@@ -45,12 +47,19 @@ Interpolated strings are represented with the following HsExpr tree:
We'll expand this during the renamer phase into the equivalent of:
- import GHC.Internal.Data.String.Interpolate
+ mconcat
+ [ fromString "Hello "
+ , interpolate (Text.toUpper name)
+ , fromString "!"
+ ]
- fromBuilder $
- toBuilder "Hello "
- <> interpolate (Text.toUpper name)
- <> toBuilder "!"
+If using QualifiedLiterals (mQualMod is Just), expand to:
+
+ ModName.fromParts
+ [ ModName.fromString "Hello "
+ , ModName.interpolate (Text.toUpper name)
+ , ModName.fromString "!"
+ ]
We're doing this in the renamer phase so that the expanded expression
can be typechecked as usual, without any additional work.
@@ -61,42 +70,77 @@ can be typechecked as usual, without any additional work.
-- necessary.
--
-- TODO(bchinn): allow -XRebindableSyntax -- lookupSyntaxName
-rewriteInterString :: HsStringType -> [HsInterStringPart GhcRn] -> RnM (HsExpr GhcRn, FreeVars)
-rewriteInterString strType parts = do
+rewriteInterString ::
+ Maybe ModuleName
+ -> HsStringType
+ -> [HsInterStringPart GhcRn]
+ -> RnM (HsExpr GhcRn, FreeVars)
+rewriteInterString mQualMod strType parts = do
overloaded <- xoptM LangExt.OverloadedStrings
- (parts', fvs) <- unzip <$> mapM (rewritePart overloaded) parts
+ mQualNames <- traverse lookupQualifiedLiteralStringsNames mQualMod
+ rewriteInterStringImpl overloaded mQualNames strType parts
+
+rewriteInterStringImpl ::
+ Bool
+ -> Maybe QualifiedLiteralStringsNames
+ -> HsStringType
+ -> [HsInterStringPart GhcRn]
+ -> RnM (HsExpr GhcRn, FreeVars)
+rewriteInterStringImpl overloaded mQualNames strType parts = do
+ (parts', fvs) <- unzip <$> mapM rewritePart parts
let expr =
- (if overloaded then id else addSig) . nlHsApp (nlHsVar fromBuilderName) $
- maybe (nlHsVar memptyName) (foldr1 appendParts) (NE.nonEmpty parts')
+ addSig
+ . (nlHsApp $ nlHsVar $ maybe mconcatName qualFromParts mQualNames)
+ $ noLocA (ExplicitList noExtField parts')
pure (unLoc expr, plusFVs fvs)
where
- appendParts l r = nlHsApps mappendName [l, r]
- rewritePart overloaded = \case
- HsInterStringRaw _ s -> do
- (lit, fvs) <- mkStringLit overloaded s
- pure (nlHsApps toBuilderName [lit], fvs)
- HsInterStringExpr _ e ->
- pure (nlHsApps interpolateName [e], emptyFVs)
-
- -- Add ":: String" to the given expression
- addSig e =
- noLocA . ExprWithTySig noExtField e $
- HsWC
- { hswc_ext = []
- , hswc_body =
- noLocA
- HsSig
- { sig_ext = noExtField
- , sig_bndrs = HsOuterImplicit []
- , sig_body = nlHsTyVar NotPromoted stringTyConName
- }
- }
-
- mkStringLit overloaded s = do
+ rewritePart = \case
+ HsInterStringRaw _ s -> mkStringLit s
+ HsInterStringExpr _ e -> do
+ let interpolateName' = maybe interpolateName qualInterpolate mQualNames
+ pure (nlHsApp (nlHsVar interpolateName') e, emptyFVs)
+
+ addSig e
+ | Just _ <- mQualNames = e
+ | overloaded = e
+ | otherwise =
+ -- explicitly add ":: String" if not overloaded
+ noLocA . ExprWithTySig noExtField e $
+ HsWC
+ { hswc_ext = []
+ , hswc_body =
+ noLocA
+ HsSig
+ { sig_ext = noExtField
+ , sig_bndrs = HsOuterImplicit []
+ , sig_body = nlHsTyVar NotPromoted stringTyConName
+ }
+ }
+
+ mkStringLit s = do
let src = SourceText $ fsLit $ "\"" ++ unpackFS s ++ "\""
- if overloaded
- then do
- (expr, fvs) <- rnOverLit noExtField $ OverLit noExtField (HsIsString src s)
- pure (noLocA expr, fvs)
- else
- pure (nlHsLit $ HsString src strType s, emptyFVs)
+ let lit = nlHsLit $ HsString src strType s
+ if
+ | Just qualNames <- mQualNames -> do
+ pure (nlHsApp (nlHsVar $ qualFromString qualNames) lit, emptyFVs)
+ | overloaded -> do
+ (expr, fvs) <- rnOverLit noExtField $ OverLit noExtField (HsIsString src s)
+ pure (noLocA expr, fvs)
+ | otherwise -> do
+ pure (lit, emptyFVs)
+
+data QualifiedLiteralStringsNames = QualifiedLiteralStringsNames
+ { qualFromString :: Name
+ , qualInterpolate :: Name
+ , qualFromParts :: Name
+ }
+
+lookupQualifiedLiteralStringsNames ::
+ ModuleName -> RnM QualifiedLiteralStringsNames
+lookupQualifiedLiteralStringsNames modName = do
+ qualFromString <- lookup "fromString"
+ qualInterpolate <- lookup "interpolate"
+ qualFromParts <- lookup "fromParts"
+ pure QualifiedLiteralStringsNames{..}
+ where
+ lookup = lookupOccRn WL_None . mkRdrQual modName . mkVarOcc
=====================================
compiler/GHC/Tc/Types/Origin.hs
=====================================
@@ -727,7 +727,7 @@ exprCtOrigin (ExplicitList {}) = ListOrigin
exprCtOrigin (HsIPVar _ ip) = IPOccOrigin ip
exprCtOrigin (HsOverLit _ lit) = LiteralOrigin lit
exprCtOrigin (HsLit {}) = Shouldn'tHappenOrigin "concrete literal"
-exprCtOrigin (HsInterString _ _ _) = InterStringOrigin
+exprCtOrigin (HsInterString _ _ _ _) = InterStringOrigin
exprCtOrigin (HsLam _ _ ms) = matchesCtOrigin ms
exprCtOrigin (HsApp _ e1 _) = lexprCtOrigin e1
exprCtOrigin (HsAppType _ e1 _) = lexprCtOrigin e1
=====================================
compiler/GHC/Tc/Zonk/Type.hs
=====================================
@@ -955,7 +955,7 @@ zonkExpr (HsOverLit x lit)
= do { lit' <- zonkOverLit lit
; return (HsOverLit x lit') }
-zonkExpr (HsInterString x _ _) = dataConCantHappen x
+zonkExpr (HsInterString x _ _ _) = dataConCantHappen x
zonkExpr (HsLam x lam_variant matches)
= do new_matches <- zonkMatchGroup zonkLExpr matches
=====================================
compiler/GHC/ThToHs.hs
=====================================
@@ -1226,11 +1226,12 @@ cvtl e = wrapLA (cvt e)
; let tele = setTelescopeBndrsNameSpace varName $
mkHsForAllVisTele noAnn tvs'
; return $ HsForAll noExtField tele body' }
- cvt (InterStringE parts) = do
+ cvt (InterStringE mQualMod parts) = do
+ let mQualMod' = mk_mod <$> mQualMod
parts' <- forM parts $ \case
InterStringRaw s -> pure $ HsInterStringRaw (SourceText $ fsLit s) (fsLit s)
InterStringExp e -> HsInterStringExpr noExtField <$> cvtl e
- return $ HsInterString noExtField HsStringTypeSingle parts'
+ return $ HsInterString noExtField mQualMod' HsStringTypeSingle parts'
{- | #16895 Ensure an infix expression's operator is a variable/constructor.
Consider this example:
=====================================
compiler/Language/Haskell/Syntax/Expr.hs
=====================================
@@ -349,6 +349,7 @@ data HsExpr p
| -- | See Note [Parsing interpolated strings]
HsInterString
(XInterString p)
+ (Maybe ModuleName) -- ^ Module, if using QualifiedLiterals
HsStringType
[HsInterStringPart p]
=====================================
libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
=====================================
@@ -250,9 +250,13 @@ pprExp i (ForallE tvars body) =
pprExp i (ConstrainedE ctx body) =
parensIf (i >= funPrec) $ sep [pprCtxWith pprExp ctx, pprExp qualPrec body]
-pprExp _ (InterStringE parts) =
- text "s\""<> hcat (map pprInterStringPart parts) <> text "\""
+pprExp _ (InterStringE mQualMod parts) =
+ prefix <> char '"' <> hcat (map pprInterStringPart parts) <> char '"'
where
+ prefix =
+ case mQualMod of
+ Nothing -> char 's'
+ Just qualMod -> text (modString qualMod) <> char '.'
pprInterStringPart = \case
InterStringRaw s -> text s
InterStringExp e -> text "${" <> pprExp noPrec e <> text "}"
=====================================
libraries/ghc-experimental/src/Data/String/Interpolate/Experimental.hs
=====================================
@@ -15,11 +15,7 @@ See the proposal for motivation and explanations:
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0570-s…
-}
module Data.String.Interpolate.Experimental (
- Buildable (..),
Interpolate (..),
-
- -- * Built-in builders
- StringBuilder (..),
) where
import GHC.Internal.Data.String.Interpolate
=====================================
libraries/ghc-internal/src/GHC/Internal/Data/String/Interpolate.hs
=====================================
@@ -20,62 +20,66 @@
-----------------------------------------------------------------------------
module GHC.Internal.Data.String.Interpolate (
- Buildable (..),
Interpolate (..),
-
- -- * Built-in builders
- StringBuilder (..),
) where
import GHC.Internal.Base
-import GHC.Internal.Data.Monoid (Endo (..))
-import GHC.Internal.Show (Show, shows)
-
--- | @Buildable s@ allows @s@ to be built from an interpolated string.
---
--- Laws:
--- * @fromBuilder . toBuilder === id@
--- * @toBuilder . fromBuilder === id@
-class Monoid (Builder s) => Buildable s where
- type Builder s = r | r -> s
- toBuilder :: s -> Builder s
- fromBuilder :: Builder s -> s
+import GHC.Internal.Data.Either (Either (..))
+import GHC.Internal.Data.List (intercalate)
+import GHC.Internal.Show (show)
-- | @Interpolate a s@ allows a value of type @a@ to be interpolated
-- into a string interpolation of type @s@.
---
--- Laws:
--- * @interpolate \@s \@s = toBuilder@
--- * @interpolate \@(Builder s) \@s = id@
-class Buildable s => Interpolate a s where
- interpolate :: a -> Builder s
-
-newtype StringBuilder = StringBuilder (Endo String)
- deriving newtype (Semigroup, Monoid)
-
-instance Buildable String where
- type Builder String = StringBuilder
- toBuilder = toStringBuilder
- fromBuilder = fromStringBuilder
-
-{-# RULES
-"fromStringBuilder/toStringBuilder" forall s. fromStringBuilder (toStringBuilder s) = s
-"toStringBuilder/fromStringBuilder" forall s. toStringBuilder (fromStringBuilder s) = s
- #-}
-
-toStringBuilder :: String -> StringBuilder
-toStringBuilder s = StringBuilder (Endo (s ++))
-{-# NOINLINE [2] toStringBuilder #-}
-
-fromStringBuilder :: StringBuilder -> String
-fromStringBuilder (StringBuilder (Endo f)) = f ""
-{-# NOINLINE [2] fromStringBuilder #-}
+class Interpolate a s where
+ interpolate :: a -> s
instance Interpolate String String where
- interpolate = toBuilder
-instance Interpolate StringBuilder String where
interpolate = id
instance Interpolate Char String where
interpolate = interpolate . (:[])
-instance {-# OVERLAPPABLE #-} Show a => Interpolate a String where
- interpolate = StringBuilder . Endo . shows
+
+instance Interpolate Int String where
+ interpolate = show
+instance Interpolate Double String where
+ interpolate = show
+instance Interpolate Bool String where
+ interpolate = show
+
+instance {-# OVERLAPPABLE #-}
+ ( Interpolate a String
+ ) => Interpolate [a] String where
+ interpolate as = "[" ++ (intercalate ", " . map interpolate) as ++ "]"
+instance
+ ( Interpolate a String
+ , Interpolate b String
+ ) => Interpolate (Either a b) String where
+ interpolate (Left a) = "Left " ++ interpolate a
+ interpolate (Right b) = "Right " ++ interpolate b
+
+instance
+ ( Interpolate a String
+ , Interpolate b String
+ ) => Interpolate (a, b) String where
+ interpolate (a, b) =
+ mconcat
+ [ "("
+ , interpolate a
+ , ", "
+ , interpolate b
+ , ")"
+ ]
+instance
+ ( Interpolate a String
+ , Interpolate b String
+ , Interpolate c String
+ ) => Interpolate (a, b, c) String where
+ interpolate (a, b, c) =
+ mconcat
+ [ "("
+ , interpolate a
+ , ", "
+ , interpolate b
+ , ", "
+ , interpolate c
+ , ")"
+ ]
=====================================
libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
=====================================
@@ -166,6 +166,7 @@ data Extension
| ListTuplePuns
| MultilineStrings
| StringInterpolation
+ | QualifiedLiterals
| ExplicitLevelImports
| ImplicitStagePersistence
deriving (Eq, Enum, Show, Generic, Bounded)
=====================================
libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
=====================================
@@ -450,8 +450,8 @@ forallVisE tvars body = ForallVisE <$> sequenceA tvars <*> body
constrainedE :: Quote m => [m Exp] -> m Exp -> m Exp
constrainedE ctx body = ConstrainedE <$> sequenceA ctx <*> body
-interStringE :: Quote m => [m InterStringPart] -> m Exp
-interStringE parts = InterStringE <$> sequenceA parts
+interStringE :: Quote m => Maybe ModName -> [m InterStringPart] -> m Exp
+interStringE mQualMod parts = InterStringE mQualMod <$> sequenceA parts
-------------------------------------------------------------------------------
-- * Dec
=====================================
libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
=====================================
@@ -1903,7 +1903,9 @@ data Exp
| ForallE [TyVarBndr Specificity] Exp -- ^ @forall \<vars\>. \<expr\>@
| ForallVisE [TyVarBndr ()] Exp -- ^ @forall \<vars\> -> \<expr\>@
| ConstrainedE [Exp] Exp -- ^ @\<ctxt\> => \<expr\>@
- | InterStringE [InterStringPart] -- ^ @{ s"Name: ${personName}" }@
+ | InterStringE -- ^ @{ s"Name: ${personName}" }@ or @{ Mod."A ${x}" }@
+ (Maybe ModName)
+ [InterStringPart]
deriving( Show, Eq, Ord, Data, Generic )
-- | A (field name, expression) pair. See 'RecConE' and 'RecUpdE'.
=====================================
testsuite/tests/driver/T4437.hs
=====================================
@@ -36,7 +36,7 @@ check title expected got
-- See Note [Adding a language extension] in compiler/GHC/Driver/Session.hs.
expectedGhcOnlyExtensions :: [String]
-expectedGhcOnlyExtensions = [ "StringInterpolation" ]
+expectedGhcOnlyExtensions = [ "StringInterpolation", "QualifiedLiterals" ]
expectedCabalOnlyExtensions :: [String]
expectedCabalOnlyExtensions = ["Generics",
=====================================
testsuite/tests/parser/should_run/StringInterpolationOverloaded.hs
=====================================
@@ -1,5 +1,3 @@
-{-# LANGUAGE DerivingStrategies #-}
-{-# LANGUAGE GeneralisedNewtypeDeriving #-}
{-# LANGUAGE MultilineStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
@@ -77,17 +75,9 @@ data SqlValue
| SqlInt Int
deriving (Show)
-newtype SqlQueryBuilder = SqlQueryBuilder (Endo SqlQuery)
- deriving newtype (Semigroup, Monoid)
-
-instance Buildable SqlQuery where
- type Builder SqlQuery = SqlQueryBuilder
- toBuilder q = SqlQueryBuilder (Endo (q <>))
- fromBuilder (SqlQueryBuilder (Endo f)) = f mempty
-
instance Interpolate SqlQuery SqlQuery where
- interpolate = toBuilder
+ interpolate = id
instance Interpolate String SqlQuery where
- interpolate s = toBuilder SqlQuery{sqlText = "?", sqlValues = [SqlString s]}
+ interpolate s = SqlQuery{sqlText = "?", sqlValues = [SqlString s]}
instance Interpolate Int SqlQuery where
- interpolate x = toBuilder SqlQuery{sqlText = "?", sqlValues = [SqlInt x]}
+ interpolate x = SqlQuery{sqlText = "?", sqlValues = [SqlInt x]}
=====================================
testsuite/tests/parser/should_run/StringInterpolationQualified.hs
=====================================
@@ -0,0 +1,44 @@
+{-# LANGUAGE MultilineStrings #-}
+{-# LANGUAGE QualifiedLiterals #-}
+{-# LANGUAGE RecordWildCards #-}
+
+import qualified StringInterpolationQualified_SQL as SQL
+
+main :: IO ()
+main = mapM_ runTest allTests
+
+data TestCase =
+ forall a. Show a =>
+ TestCase
+ { label :: String
+ , expression :: a
+ }
+
+runTest :: TestCase -> IO ()
+runTest TestCase{..} = do
+ putStrLn $ "****************************************"
+ putStrLn $ "Input:"
+ putStr $ unlines . map (" " ++) . lines $ label
+ putStrLn $ "====>"
+ putStrLn $ " " ++ show expression
+
+allTests :: [TestCase]
+allTests =
+ [ TestCase -- custom interpolation implementations
+ { label =
+ """
+ let
+ name = "'Robert'; DROP TABLE Students;--"
+ age = 10 :: Int
+ in
+ SQL."SELECT * FROM tab WHERE name ILIKE ${name} and age = ${age}"
+ """
+ , expression =
+ let
+ name = "'Robert'; DROP TABLE Students;--"
+ age = 10 :: Int
+ in
+ SQL."SELECT * FROM tab WHERE name ILIKE ${name} and age = ${age}"
+ }
+ -- TODO(bchinn): qualified interpolated multiline string
+ ]
=====================================
testsuite/tests/parser/should_run/StringInterpolationQualified.stdout
=====================================
@@ -0,0 +1,9 @@
+****************************************
+Input:
+ let
+ name = "'Robert'; DROP TABLE Students;--"
+ age = 10 :: Int
+ in
+ SQL."SELECT * FROM tab WHERE name ILIKE ${name} and age = ${age}"
+====>
+ SqlQuery {sqlText = "SELECT * FROM tab WHERE name ILIKE ? and age = ?", sqlValues = [SqlString "'Robert'; DROP TABLE Students;--",SqlInt 10]}
=====================================
testsuite/tests/parser/should_run/StringInterpolationQualified_SQL.hs
=====================================
@@ -0,0 +1,47 @@
+module StringInterpolationQualified_SQL where
+
+import qualified Data.String
+
+data SqlQuery = SqlQuery
+ { sqlText :: String
+ , sqlValues :: [SqlValue]
+ }
+ deriving (Show)
+
+instance Data.String.IsString SqlQuery where
+ fromString s = SqlQuery{sqlText = s, sqlValues = []}
+instance Semigroup SqlQuery where
+ q1 <> q2 =
+ SqlQuery
+ { sqlText = sqlText q1 <> sqlText q2
+ , sqlValues = sqlValues q1 <> sqlValues q2
+ }
+instance Monoid SqlQuery where
+ mempty =
+ SqlQuery
+ { sqlText = ""
+ , sqlValues = []
+ }
+
+data SqlValue
+ = SqlString String
+ | SqlInt Int
+ deriving (Show)
+
+class ToSqlValue a where
+ toSqlValue :: a -> SqlValue
+instance ToSqlValue String where
+ toSqlValue = SqlString
+instance ToSqlValue Int where
+ toSqlValue = SqlInt
+
+{----- QualifiedLiterals -----}
+
+fromString :: String -> SqlQuery
+fromString = Data.String.fromString
+
+interpolate :: ToSqlValue a => a -> SqlQuery
+interpolate v = SqlQuery{sqlText = "?", sqlValues = [toSqlValue v]}
+
+fromParts :: [SqlQuery] -> SqlQuery
+fromParts = mconcat
=====================================
testsuite/tests/parser/should_run/all.T
=====================================
@@ -38,3 +38,4 @@ test('T25784', normal, compile_and_run, [''])
# String interpolation
test('StringInterpolation', normal, compile_and_run, [''])
test('StringInterpolationOverloaded', normal, compile_and_run, [''])
+test('StringInterpolationQualified', [extra_files(['StringInterpolationQualified_SQL.hs'])], multimod_compile_and_run, ['StringInterpolationQualified', ''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d114d7ddd044760d1494c2e65c75226…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d114d7ddd044760d1494c2e65c75226…
You're receiving this email because of your account on gitlab.haskell.org.
1
0

[Git][ghc/ghc][wip/T25989] 22 commits: RTS: remove target info and fix host info (#24058)
by Ben Gamari (@bgamari) 30 Apr '25
by Ben Gamari (@bgamari) 30 Apr '25
30 Apr '25
Ben Gamari pushed to branch wip/T25989 at Glasgow Haskell Compiler / GHC
Commits:
b96e2f77 by Sylvain Henry at 2025-04-18T20:46:33-04:00
RTS: remove target info and fix host info (#24058)
The RTS isn't a compiler, hence it doesn't have a target and we remove
the reported target info displayed by "+RTS --info". We also fix the
host info displayed by "+RTS --info": the host of the RTS is the
RTS-building compiler's target, not the compiler's host (wrong when
doing cross-compilation).
- - - - -
6d9965f4 by Sylvain Henry at 2025-04-18T20:46:33-04:00
RTS: remove build info
As per the discussion in !13967, there is no reason to tag the RTS with
information about the build platform.
- - - - -
d52e9b3f by Vladislav Zavialov at 2025-04-18T20:47:15-04:00
Diagnostics: remove the KindMismatch constructor (#25957)
The KindMismatch constructor was only used as an intermediate
representation in pretty-printing.
Its removal addresses a problem detected by the "codes" test case:
[GHC-89223] is untested (constructor = KindMismatch)
In a concious deviation from the usual procedure, the error code
GHC-89223 is removed entirely rather than marked as Outdated.
The reason is that it never was user-facing in the first place.
- - - - -
e2f2f9d0 by Vladislav Zavialov at 2025-04-20T10:53:39-04:00
Add name for -Wunusable-unpack-pragmas
This warning had no name or flag and was triggered unconditionally.
Now it is part of -Wdefault.
In GHC.Tc.TyCl.tcTyClGroupsPass's strict mode, we now have to
force-enable this warning to ensure that detection of flawed groups
continues to work even if the user disables the warning with the
-Wno-unusable-unpack-pragmas option. Test case: T3990c
Also, the misnamed BackpackUnpackAbstractType is now called
UnusableUnpackPragma.
- - - - -
6caa6508 by Adam Gundry at 2025-04-20T10:54:22-04:00
Fix specialisation of incoherent instances (fixes #25883)
GHC normally assumes that class constraints are canonical, meaning that
the specialiser is allowed to replace one dictionary argument with another
provided that they have the same type. The `-fno-specialise-incoherents`
flag alters INCOHERENT instance definitions so that they will prevent
specialisation in some cases, by inserting `nospec`.
This commit fixes a bug in 7124e4ad76d98f1fc246ada4fd7bf64413ff2f2e, which
treated some INCOHERENT instance matches as if `-fno-specialise-incoherents`
was in effect, thereby unnecessarily preventing specialisation. In addition
it updates the relevant `Note [Rules for instance lookup]` and adds a new
`Note [Canonicity for incoherent matches]`.
- - - - -
0426fd6c by Adam Gundry at 2025-04-20T10:54:23-04:00
Add regression test for #23429
- - - - -
eec96527 by Adam Gundry at 2025-04-20T10:54:23-04:00
user's guide: update specification of overlapping/incoherent instances
The description of the instance resolution algorithm in the user's
guide was slightly out of date, because it mentioned in-scope given
constraints only at the end, whereas the implementation checks for
their presence before any of the other steps.
This also adds a warning to the user's guide about the impact of
incoherent instances on specialisation, and more clearly documents
some of the other effects of `-XIncoherentInstances`.
- - - - -
a00eeaec by Matthew Craven at 2025-04-20T10:55:03-04:00
Fix bytecode generation for `tagToEnum# <LITERAL>`
Fixes #25975.
- - - - -
2e204269 by Andreas Klebinger at 2025-04-22T12:20:41+02:00
Simplifier: Constant fold invald tagToEnum# calls to bottom expr.
When applying tagToEnum# to a out-of-range value it's best to simply
constant fold it to a bottom expression. That potentially allows more
dead code elimination and makes debugging easier.
Fixes #25976
- - - - -
7250fc0c by Matthew Pickering at 2025-04-22T16:24:04-04:00
Move -fno-code note into Downsweep module
This note was left behind when all the code which referred to it was
moved into the GHC.Driver.Downsweep module
- - - - -
d2dc89b4 by Matthew Pickering at 2025-04-22T16:24:04-04:00
Apply editing notes to Note [-fno-code mode] suggested by sheaf
These notes were suggested in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/14241
- - - - -
91564daf by Matthew Pickering at 2025-04-24T00:29:02-04:00
ghci: Use loadInterfaceForModule rather than loadSrcInterface in mkTopLevEnv
loadSrcInterface takes a user given `ModuleName` and resolves it to the
module which needs to be loaded (taking into account module
renaming/visibility etc).
loadInterfaceForModule takes a specific module and loads it.
The modules in `ImpDeclSpec` have already been resolved to the actual
module to get the information from during renaming. Therefore we just
need to fetch the precise interface from disk (and not attempt to rename
it again).
Fixes #25951
- - - - -
2e0c07ab by Simon Peyton Jones at 2025-04-24T00:29:43-04:00
Test for #23298
- - - - -
0eef99b0 by Sven Tennie at 2025-04-24T07:34:36-04:00
RV64: Introduce J instruction (non-local jumps) and don't deallocate stack slots for J_TBL (#25738)
J_TBL result in local jumps, there should not deallocate stack slots
(see Note [extra spill slots].)
J is for non-local jumps, these may need to deallocate stack slots.
- - - - -
1bd3d13e by fendor at 2025-04-24T07:35:17-04:00
Add `UnitId` to `EvalBreakpoint`
The `EvalBreakpoint` is used to communicate that a breakpoint was
encountered during code evaluation.
This `EvalBreakpoint` needs to be converted to an `InternalBreakpointId`
which stores a `Module` to uniquely find the correct `Module` in the
Home Package Table.
The `EvalBreakpoint` used to store only a `ModuleName` which is then
converted to a `Module` based on the currently active home unit.
This is incorrect in the face of multiple home units, the break point
could be in an entirely other home unit!
To fix this, we additionally store the `UnitId` of the `Module` in
`EvalBreakpoint` to later reconstruct the correct `Module`
All of the changes are the consequence of extending `EvalBreakpoint`
with the additional `ShortByteString` of the `UnitId`.
For performance reasons, we store the `ShortByteString` backing the
`UnitId` directly, avoiding marshalling overhead.
- - - - -
fe6ed8d9 by Sylvain Henry at 2025-04-24T18:04:12-04:00
Doc: add doc for JS interruptible calling convention (#24444)
- - - - -
6111c5e4 by Ben Gamari at 2025-04-24T18:04:53-04:00
compiler: Ensure that Panic.Plain.assertPanic' provides callstack
In 36cddd2ce1a3bc62ea8a1307d8bc6006d54109cf @alt-romes removed CallStack
output from `GHC.Utils.Panic.Plain.assertPanic'`. While this output is
redundant due to the exception backtrace proposal, we may be
bootstrapping with a compiler which does not yet include this machinery.
Reintroduce the output for now.
Fixes #25898.
- - - - -
217caad1 by Matthew Pickering at 2025-04-25T18:58:42+01:00
Implement Explicit Level Imports for Template Haskell
This commit introduces the `ExplicitLevelImports` and
`ImplicitStagePersistence` language extensions as proposed in GHC
Proposal #682.
Key Features
------------
- `ExplicitLevelImports` adds two new import modifiers - `splice` and
`quote` - allowing precise control over the level at which imported
identifiers are available
- `ImplicitStagePersistence` (enabled by default) preserves existing
path-based cross-stage persistence behavior
- `NoImplicitStagePersistence` disables implicit cross-stage
persistence, requiring explicit level imports
Benefits
--------
- Improved compilation performance by reducing unnecessary code generation
- Enhanced IDE experience with faster feedback in `-fno-code` mode
- Better dependency tracking by distinguishing compile-time and runtime dependencies
- Foundation for future cross-compilation improvements
This implementation enables the separation of modules needed at
compile-time from those needed at runtime, allowing for more efficient
compilation pipelines and clearer code organization in projects using
Template Haskell.
Implementation Notes
--------------------
The level which a name is availble at is stored in the 'GRE', in the normal
GlobalRdrEnv. The function `greLevels` returns the levels which a specific GRE
is imported at. The level information for a 'Name' is computed by `getCurrentAndBindLevel`.
The level validity is checked by `checkCrossLevelLifting`.
Instances are checked by `checkWellLevelledDFun`, which computes the level an
instance by calling `checkWellLevelledInstanceWhat`, which sees what is
available at by looking at the module graph.
Modifications to downsweep
--------------------------
Code generation is now only enabled for modules which are needed at
compile time.
See the Note [-fno-code mode] for more information.
Uniform error messages for level errors
---------------------------------------
All error messages to do with levels are now reported uniformly using
the `TcRnBadlyStaged` constructor.
Error messages are uniformly reported in terms of levels.
0 - top-level
1 - quote level
-1 - splice level
The only level hard-coded into the compiler is the top-level in
GHC.Types.ThLevelIndex.topLevelIndex.
Uniformly refer to levels and stages
------------------------------------
There was much confusion about levels vs stages in the compiler.
A level is a semantic concept, used by the typechecker to ensure a
program can be evaluated in a well-staged manner.
A stage is an operational construct, program evaluation proceeds in
stages.
Deprecate -Wbadly-staged-types
------------------------------
`-Wbadly-staged-types` is deprecated in favour of `-Wbadly-levelled-types`.
Lift derivation changed
-----------------------
Derived lift instances will now not generate code with expression
quotations.
Before:
```
data A = A Int deriving Lift
=>
lift (A x) = [| A $(lift x) |]
```
After:
```
lift (A x) = conE 'A `appE` (lift x)
```
This is because if you attempt to derive `Lift` in a module where
`NoImplicitStagePersistence` is enabled, you would get an infinite loop
where a constructor was attempted to be persisted using the instance you
are currently defining.
GHC API Changes
---------------
The ModuleGraph now contains additional information about the type of
the edges (normal, quote or splice) between modules. This is abstracted
using the `ModuleGraphEdge` data type.
Fixes #25828
-------------------------
Metric Increase:
MultiLayerModulesTH_Make
-------------------------
- - - - -
7641a74a by Simon Peyton Jones at 2025-04-26T22:05:19-04:00
Get a decent MatchContext for pattern synonym bindings
In particular when we have a pattern binding
K p1 .. pn = rhs
where K is a pattern synonym. (It might be nested.)
This small MR fixes #25995. It's a tiny fix, to an error message,
removing an always-dubious `unkSkol`.
The bug report was in the context of horde-ad, a big program,
and I didn't manage to make a small repro case quickly. I decided
not to bother further.
- - - - -
ce616f49 by Simon Peyton Jones at 2025-04-27T21:10:25+01:00
Fix infelicities in the Specialiser
On the way to #23109 (unary classes) I discovered some infelicities
(or maybe tiny bugs, I forget) in the type-class specialiser.
I also tripped over #25965, an outright bug in the rule matcher
Specifically:
* Refactor: I enhanced `wantCallsFor`, whih previously always said
`True`, to discard calls of class-ops, data constructors etc. This is
a bit more efficient; and it means we don't need to worry about
filtering them out later.
* Fix: I tidied up some tricky logic that eliminated redundant
specialisations. It wasn't working correctly. See the expanded
Note [Specialisations already covered], and
(MP3) in Note [Specialising polymorphic dictionaries].
See also the new top-level `alreadyCovered`
function, which now goes via `GHC.Core.Rules.ruleLhsIsMoreSpecific`
I also added a useful Note [The (CI-KEY) invariant]
* Fix #25965: fixed a tricky bug in the `go_fam_fam` in
`GHC.Core.Unify.uVarOrFam`, which allows matching to succeed
without binding all type varibles.
I enhanced Note [Apartness and type families] some more
* #25703. This ticket "just works" with -fpolymorphic-specialisation;
but I was surprised that it worked! In this MR I added documentation
to Note [Interesting dictionary arguments] to explain; and tests to
ensure it stays fixed.
- - - - -
22d11fa8 by Simon Peyton Jones at 2025-04-28T18:05:19-04:00
Track rewriter sets more accurately in constraint solving
The key change, which fixed #25440, is to call `recordRewriter` in
GHC.Tc.Solver.Rewrite.rewrite_exact_fam_app. This missing call meant
that we were secretly rewriting a Wanted with a Wanted, but not really
noticing; and that led to a very bad error message, as you can see
in the ticket.
But of course that led me into rabbit hole of other refactoring around
the RewriteSet code:
* Improve Notes [Wanteds rewrite Wanteds]
* Zonk the RewriterSet in `zonkCtEvidence` rather than only in GHC.Tc.Errors.
This is tidier anyway (e.g. de-clutters debug output), and helps with the
next point.
* In GHC.Tc.Solver.Equality.inertsCanDischarge, don't replace a constraint
with no rewriters with an equal constraint that has many. See
See (CE4) in Note [Combining equalities]
* Move zonkRewriterSet and friends from GHC.Tc.Zonk.Type into
GHC.Tc.Zonk.TcType, where they properly belong.
A handful of tests get better error messages.
For some reason T24984 gets 12% less compiler allocation -- good
Metric Decrease:
T24984
- - - - -
5ddbe01c by Ben Gamari at 2025-04-29T09:50:06-04:00
Don't emit unprintable characters when printing Uniques
When faced with an unprintable tag we now instead print the codepoint
number.
Fixes #25989.
(cherry picked from commit e832b1fadee66e8d6dd7b019368974756f8f8c46)
- - - - -
350 changed files:
- compiler/GHC.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/CmmToAsm/RV64/CodeGen.hs
- compiler/GHC/CmmToAsm/RV64/Instr.hs
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/Graph/Directed/Reachability.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/MakeFile.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/HsToCore/Breakpoints.hs
- compiler/GHC/Iface/Recomp.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/Tc/Deriv/Generate.hs
- compiler/GHC/Tc/Deriv/Utils.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Plugin.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Instance.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Types/LclEnv.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Types/TH.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Concrete.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Name/Reader.hs
- + compiler/GHC/Types/ThLevelIndex.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Unit/Home/PackageTable.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/Graph.hs
- compiler/GHC/Unit/Module/Imported.hs
- compiler/GHC/Unit/Module/ModSummary.hs
- + compiler/GHC/Unit/Module/Stage.hs
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Panic/Plain.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- + compiler/Language/Haskell/Syntax/ImpExp/IsBoot.hs
- compiler/ghc.cabal.in
- configure.ac
- docs/users_guide/9.14.1-notes.rst
- docs/users_guide/exts/control.rst
- docs/users_guide/exts/instances.rst
- docs/users_guide/exts/template_haskell.rst
- docs/users_guide/javascript.rst
- docs/users_guide/phases.rst
- docs/users_guide/using-warnings.rst
- ghc/GHCi/UI.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/tests/IO/Makefile
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- rts/Exception.cmm
- rts/Interpreter.c
- rts/RtsUtils.c
- testsuite/ghc-config/ghc-config.hs
- testsuite/tests/ado/ado004.stderr
- testsuite/tests/annotations/should_fail/annfail03.stderr
- testsuite/tests/annotations/should_fail/annfail04.stderr
- testsuite/tests/annotations/should_fail/annfail06.stderr
- testsuite/tests/annotations/should_fail/annfail09.stderr
- + testsuite/tests/bytecode/T25975.hs
- + testsuite/tests/bytecode/T25975.stdout
- testsuite/tests/bytecode/all.T
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/dependent/should_compile/T14729.stderr
- testsuite/tests/dependent/should_compile/T15743.stderr
- testsuite/tests/dependent/should_compile/T15743e.stderr
- testsuite/tests/deriving/should_compile/T14682.stderr
- testsuite/tests/determinism/determ021/determ021.stdout
- testsuite/tests/diagnostic-codes/codes.stdout
- + testsuite/tests/driver/T4437.stdout
- testsuite/tests/driver/json2.stderr
- testsuite/tests/gadt/T19847a.stderr
- + testsuite/tests/gadt/T23298.hs
- + testsuite/tests/gadt/T23298.stderr
- testsuite/tests/gadt/all.T
- testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs
- testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs
- + testsuite/tests/ghci/scripts/GhciPackageRename.hs
- + testsuite/tests/ghci/scripts/GhciPackageRename.script
- + testsuite/tests/ghci/scripts/GhciPackageRename.stdout
- testsuite/tests/ghci/scripts/all.T
- testsuite/tests/indexed-types/should_compile/T15711.stderr
- testsuite/tests/indexed-types/should_compile/T15852.stderr
- testsuite/tests/indexed-types/should_compile/T3017.stderr
- testsuite/tests/indexed-types/should_fail/T3330c.stderr
- testsuite/tests/indexed-types/should_fail/T4174.stderr
- testsuite/tests/indexed-types/should_fail/T8227.stderr
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/module/mod185.stderr
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- testsuite/tests/parser/should_compile/KindSigs.stderr
- testsuite/tests/parser/should_compile/T14189.stderr
- testsuite/tests/partial-sigs/should_compile/ADT.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr1.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr2.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr3.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr4.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr5.stderr
- testsuite/tests/partial-sigs/should_compile/AddAndOr6.stderr
- testsuite/tests/partial-sigs/should_compile/BoolToBool.stderr
- testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting1MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROff.stderr
- testsuite/tests/partial-sigs/should_compile/Defaulting2MROn.stderr
- testsuite/tests/partial-sigs/should_compile/Either.stderr
- testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
- testsuite/tests/partial-sigs/should_compile/Every.stderr
- testsuite/tests/partial-sigs/should_compile/EveryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSig.stderr
- testsuite/tests/partial-sigs/should_compile/ExpressionSigNamed.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints1.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints2.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROff.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraNumAMROn.stderr
- testsuite/tests/partial-sigs/should_compile/Forall1.stderr
- testsuite/tests/partial-sigs/should_compile/GenNamed.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank1.stderr
- testsuite/tests/partial-sigs/should_compile/HigherRank2.stderr
- testsuite/tests/partial-sigs/should_compile/LocalDefinitionBug.stderr
- testsuite/tests/partial-sigs/should_compile/Meltdown.stderr
- testsuite/tests/partial-sigs/should_compile/MonoLocalBinds.stderr
- testsuite/tests/partial-sigs/should_compile/NamedTyVar.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/NamedWildcardInTypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/ParensAroundContext.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind.stderr
- testsuite/tests/partial-sigs/should_compile/PatBind2.stderr
- testsuite/tests/partial-sigs/should_compile/PatternSig.stderr
- testsuite/tests/partial-sigs/should_compile/Recursive.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcards.stderr
- testsuite/tests/partial-sigs/should_compile/ScopedNamedWildcardsGood.stderr
- testsuite/tests/partial-sigs/should_compile/ShowNamed.stderr
- testsuite/tests/partial-sigs/should_compile/SimpleGen.stderr
- testsuite/tests/partial-sigs/should_compile/SkipMany.stderr
- testsuite/tests/partial-sigs/should_compile/SomethingShowable.stderr
- testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
- testsuite/tests/partial-sigs/should_compile/Uncurry.stderr
- testsuite/tests/partial-sigs/should_compile/UncurryNamed.stderr
- testsuite/tests/partial-sigs/should_compile/WarningWildcardInstantiations.stderr
- testsuite/tests/polykinds/T15592.stderr
- testsuite/tests/polykinds/T15592b.stderr
- testsuite/tests/printer/T18052a.stderr
- testsuite/tests/quasiquotation/qq001/qq001.stderr
- testsuite/tests/quasiquotation/qq002/qq002.stderr
- testsuite/tests/quasiquotation/qq003/qq003.stderr
- testsuite/tests/quasiquotation/qq004/qq004.stderr
- + testsuite/tests/quotes/T5721.stderr
- testsuite/tests/roles/should_compile/Roles1.stderr
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles2.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/showIface/DocsInHiFile1.stdout
- testsuite/tests/showIface/DocsInHiFileTH.stdout
- testsuite/tests/showIface/HaddockIssue849.stdout
- testsuite/tests/showIface/HaddockOpts.stdout
- testsuite/tests/showIface/HaddockSpanIssueT24378.stdout
- testsuite/tests/showIface/LanguageExts.stdout
- testsuite/tests/showIface/MagicHashInHaddocks.stdout
- testsuite/tests/showIface/NoExportList.stdout
- testsuite/tests/showIface/PragmaDocs.stdout
- testsuite/tests/showIface/ReExports.stdout
- testsuite/tests/simplCore/should_compile/Makefile
- testsuite/tests/simplCore/should_compile/T23307c.stderr
- + testsuite/tests/simplCore/should_compile/T25703.hs
- + testsuite/tests/simplCore/should_compile/T25703.stderr
- + testsuite/tests/simplCore/should_compile/T25703a.hs
- + testsuite/tests/simplCore/should_compile/T25703a.stderr
- + testsuite/tests/simplCore/should_compile/T25883.hs
- + testsuite/tests/simplCore/should_compile/T25883.substr-simpl
- + testsuite/tests/simplCore/should_compile/T25883b.hs
- + testsuite/tests/simplCore/should_compile/T25883b.substr-simpl
- + testsuite/tests/simplCore/should_compile/T25883c.hs
- + testsuite/tests/simplCore/should_compile/T25883c.substr-simpl
- + testsuite/tests/simplCore/should_compile/T25883d.hs
- + testsuite/tests/simplCore/should_compile/T25883d.stderr
- + testsuite/tests/simplCore/should_compile/T25883d_import.hs
- + testsuite/tests/simplCore/should_compile/T25965.hs
- + testsuite/tests/simplCore/should_compile/T25976.hs
- + testsuite/tests/simplCore/should_compile/T3990c.hs
- + testsuite/tests/simplCore/should_compile/T3990c.stdout
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/simplCore/should_fail/T25672.stderr
- + testsuite/tests/simplCore/should_run/T23429.hs
- + testsuite/tests/simplCore/should_run/T23429.stdout
- testsuite/tests/simplCore/should_run/all.T
- + testsuite/tests/splice-imports/ClassA.hs
- + testsuite/tests/splice-imports/InstanceA.hs
- + testsuite/tests/splice-imports/Makefile
- + testsuite/tests/splice-imports/SI01.hs
- + testsuite/tests/splice-imports/SI01A.hs
- + testsuite/tests/splice-imports/SI02.hs
- + testsuite/tests/splice-imports/SI03.hs
- + testsuite/tests/splice-imports/SI03.stderr
- + testsuite/tests/splice-imports/SI04.hs
- + testsuite/tests/splice-imports/SI05.hs
- + testsuite/tests/splice-imports/SI05.stderr
- + testsuite/tests/splice-imports/SI05A.hs
- + testsuite/tests/splice-imports/SI06.hs
- + testsuite/tests/splice-imports/SI07.hs
- + testsuite/tests/splice-imports/SI07.stderr
- + testsuite/tests/splice-imports/SI07A.hs
- + testsuite/tests/splice-imports/SI08.hs
- + testsuite/tests/splice-imports/SI08.stderr
- + testsuite/tests/splice-imports/SI08_oneshot.stderr
- + testsuite/tests/splice-imports/SI09.hs
- + testsuite/tests/splice-imports/SI10.hs
- + testsuite/tests/splice-imports/SI13.hs
- + testsuite/tests/splice-imports/SI14.hs
- + testsuite/tests/splice-imports/SI14.stderr
- + testsuite/tests/splice-imports/SI15.hs
- + testsuite/tests/splice-imports/SI15.stderr
- + testsuite/tests/splice-imports/SI16.hs
- + testsuite/tests/splice-imports/SI16.stderr
- + testsuite/tests/splice-imports/SI17.hs
- + testsuite/tests/splice-imports/SI18.hs
- + testsuite/tests/splice-imports/SI18.stderr
- + testsuite/tests/splice-imports/SI19.hs
- + testsuite/tests/splice-imports/SI19A.hs
- + testsuite/tests/splice-imports/SI20.hs
- + testsuite/tests/splice-imports/SI20.stderr
- + testsuite/tests/splice-imports/SI21.hs
- + testsuite/tests/splice-imports/SI21.stderr
- + testsuite/tests/splice-imports/SI22.hs
- + testsuite/tests/splice-imports/SI22.stderr
- + testsuite/tests/splice-imports/SI23.hs
- + testsuite/tests/splice-imports/SI23A.hs
- + testsuite/tests/splice-imports/SI24.hs
- + testsuite/tests/splice-imports/SI25.hs
- + testsuite/tests/splice-imports/SI25.stderr
- + testsuite/tests/splice-imports/SI25Helper.hs
- + testsuite/tests/splice-imports/SI26.hs
- + testsuite/tests/splice-imports/SI27.hs
- + testsuite/tests/splice-imports/SI27.stderr
- + testsuite/tests/splice-imports/SI28.hs
- + testsuite/tests/splice-imports/SI28.stderr
- + testsuite/tests/splice-imports/SI29.hs
- + testsuite/tests/splice-imports/SI29.stderr
- + testsuite/tests/splice-imports/SI30.script
- + testsuite/tests/splice-imports/SI30.stdout
- + testsuite/tests/splice-imports/SI31.script
- + testsuite/tests/splice-imports/SI31.stderr
- + testsuite/tests/splice-imports/SI32.script
- + testsuite/tests/splice-imports/SI32.stdout
- + testsuite/tests/splice-imports/SI33.script
- + testsuite/tests/splice-imports/SI33.stdout
- + testsuite/tests/splice-imports/SI34.hs
- + testsuite/tests/splice-imports/SI34.stderr
- + testsuite/tests/splice-imports/SI34M1.hs
- + testsuite/tests/splice-imports/SI34M2.hs
- + testsuite/tests/splice-imports/SI35.hs
- + testsuite/tests/splice-imports/SI35A.hs
- + testsuite/tests/splice-imports/SI36.hs
- + testsuite/tests/splice-imports/SI36.stderr
- + testsuite/tests/splice-imports/SI36_A.hs
- + testsuite/tests/splice-imports/SI36_B1.hs
- + testsuite/tests/splice-imports/SI36_B2.hs
- + testsuite/tests/splice-imports/SI36_B3.hs
- + testsuite/tests/splice-imports/SI36_C1.hs
- + testsuite/tests/splice-imports/SI36_C2.hs
- + testsuite/tests/splice-imports/SI36_C3.hs
- + testsuite/tests/splice-imports/all.T
- testsuite/tests/th/T16976z.stderr
- testsuite/tests/th/T17820a.stderr
- testsuite/tests/th/T17820b.stderr
- testsuite/tests/th/T17820c.stderr
- testsuite/tests/th/T17820d.stderr
- testsuite/tests/th/T17820e.stderr
- testsuite/tests/th/T21547.stderr
- testsuite/tests/th/T23829_hasty.stderr
- testsuite/tests/th/T23829_hasty_b.stderr
- testsuite/tests/th/T23829_tardy.ghc.stderr
- testsuite/tests/th/T5795.stderr
- testsuite/tests/th/TH_Roles2.stderr
- testsuite/tests/typecheck/should_compile/T12763.stderr
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_compile/T21023.stderr
- testsuite/tests/typecheck/should_compile/T25266a.stderr
- testsuite/tests/typecheck/should_compile/T7050.stderr
- testsuite/tests/typecheck/should_fail/T18851.stderr
- testsuite/tests/typecheck/should_fail/T3966.stderr
- + testsuite/tests/typecheck/should_fail/T3966b.hs
- + testsuite/tests/typecheck/should_fail/T3966b.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/unboxedsums/unpack_sums_5.stderr
- utils/check-exact/ExactPrint.hs
- utils/count-deps/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d27adfc62710035204a30795cd092e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d27adfc62710035204a30795cd092e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0