05 May '26
Vladislav Zavialov pushed to branch wip/int-index/tuple-tyfam at Glasgow Haskell Compiler / GHC
Commits:
baed06c1 by Vladislav Zavialov at 2026-05-05T23:24:01+03:00
Add Sum64#
- - - - -
11 changed files:
- compiler/GHC/Settings/Constants.hs
- libraries/base/src/GHC/Base.hs
- libraries/base/src/GHC/Exts.hs
- libraries/ghc-experimental/src/Data/Sum/Experimental.hs
- libraries/ghc-internal/src/GHC/Internal/Base.hs
- libraries/ghc-internal/src/GHC/Internal/Exts.hs
- libraries/ghc-internal/src/GHC/Internal/Types.hs
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
Changes:
=====================================
compiler/GHC/Settings/Constants.hs
=====================================
@@ -17,8 +17,8 @@ mAX_TUPLE_SIZE = 64 -- Should really match the number
mAX_CTUPLE_SIZE :: Int -- Constraint tuples
mAX_CTUPLE_SIZE = 64 -- Should match the number of decls in GHC.Classes
-mAX_SUM_SIZE :: Int -- We use 6 bits to record sum size,
-mAX_SUM_SIZE = 63 -- so max sum size is 63. Sadly inconsistent.
+mAX_SUM_SIZE :: Int
+mAX_SUM_SIZE = 64 -- Should match the number of decls in GHC.Internal.Types
-- | Default maximum depth for both class instance search and type family
-- reduction. See also #5395.
=====================================
libraries/base/src/GHC/Base.hs
=====================================
@@ -527,4 +527,5 @@ import GHC.Types hiding (
Sum61#,
Sum62#,
Sum63#,
+ Sum64#,
)
=====================================
libraries/base/src/GHC/Exts.hs
=====================================
@@ -500,4 +500,5 @@ import GHC.Types hiding (
Sum61#,
Sum62#,
Sum63#,
+ Sum64#,
)
=====================================
libraries/ghc-experimental/src/Data/Sum/Experimental.hs
=====================================
@@ -79,6 +79,7 @@ module Data.Sum.Experimental (
Sum61#,
Sum62#,
Sum63#,
+ Sum64#,
-- * Type families
TupleArgKind#,
@@ -157,3 +158,4 @@ type family Sum# ts where
Sum# (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi) = Sum61# a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi
Sum# (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj) = Sum62# a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj
Sum# (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk) = Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk
+ Sum# (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl) = Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl
=====================================
libraries/ghc-internal/src/GHC/Internal/Base.hs
=====================================
@@ -235,6 +235,7 @@ import GHC.Internal.Types hiding (
Sum61#,
Sum62#,
Sum63#,
+ Sum64#,
)
import GHC.Internal.Classes hiding (
CUnit,
=====================================
libraries/ghc-internal/src/GHC/Internal/Exts.hs
=====================================
@@ -338,6 +338,7 @@ import GHC.Internal.Types
Sum61#,
Sum62#,
Sum63#,
+ Sum64#,
)
import GHC.Internal.Prim.Ext
import GHC.Internal.ArrayArray
=====================================
libraries/ghc-internal/src/GHC/Internal/Types.hs
=====================================
@@ -195,6 +195,7 @@ module GHC.Internal.Types (
Sum61#,
Sum62#,
Sum63#,
+ Sum64#,
) where
@@ -1467,14 +1468,6 @@ data Tuple64# a b c d e f g h i j k l m n o p q r s t u v w x y z a1 b1 c1 d1 e1
(# a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,a1,b1,c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,n1,o1,p1,q1,r1,s1,t1,
u1,v1,w1,x1,y1,z1,a2,b2,c2,d2,e2,f2,g2,h2,i2,j2,k2,l2 #)
-{-
-Note [Unboxed sum with arity 64]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-While tuples are defined up to arity 64, sums can maximally have 63 alternatives.
-This is due to the Unique layout for unboxed sums, which allots only six bits
-for encoding the alternative.
--}
-
type Sum2# :: TYPE r1 -> TYPE r2 -> TYPE (SumRep [r1, r2])
data Sum2# a b =
(# a | #)
@@ -3675,3 +3668,70 @@ data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z a1 b1 c1 d1 e1 f
| (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i2 | | #)
| (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | j2 | #)
| (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | k2 #)
+
+type Sum64# :: TYPE r1 -> TYPE r2 -> TYPE r3 -> TYPE r4 -> TYPE r5 -> TYPE r6 -> TYPE r7 -> TYPE r8 -> TYPE r9 -> TYPE r10 -> TYPE r11 -> TYPE r12 -> TYPE r13 -> TYPE r14 -> TYPE r15 -> TYPE r16 -> TYPE r17 -> TYPE r18 -> TYPE r19 -> TYPE r20 -> TYPE r21 -> TYPE r22 -> TYPE r23 -> TYPE r24 -> TYPE r25 -> TYPE r26 -> TYPE r27 -> TYPE r28 -> TYPE r29 -> TYPE r30 -> TYPE r31 -> TYPE r32 -> TYPE r33 -> TYPE r34 -> TYPE r35 -> TYPE r36 -> TYPE r37 -> TYPE r38 -> TYPE r39 -> TYPE r40 -> TYPE r41 -> TYPE r42 -> TYPE r43 -> TYPE r44 -> TYPE r45 -> TYPE r46 -> TYPE r47 -> TYPE r48 -> TYPE r49 -> TYPE r50 -> TYPE r51 -> TYPE r52 -> TYPE r53 -> TYPE r54 -> TYPE r55 -> TYPE r56 -> TYPE r57 -> TYPE r58 -> TYPE r59 -> TYPE r60 -> TYPE r61 -> TYPE r62 -> TYPE r63 -> TYPE r64 -> TYPE (SumRep [r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, r26, r27, r28, r29, r30, r31, r32, r33, r34, r35, r36, r37, r38, r39, r40, r41, r42, r43, r44, r45, r46, r47, r48, r49, r50, r51, r52, r53, r54, r55, r56, r57, r58, r59, r60, r61, r62, r63, r64])
+data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z a1 b1 c1 d1 e1 f1 g1 h1 i1 j1 k1 l1 m1 n1 o1 p1 q1 r1 s1 t1 u1 v1 w1 x1 y1 z1 a2 b2 c2 d2 e2 f2 g2 h2 i2 j2 k2 l2 =
+ (# a | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | b | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | c | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | d | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | e | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | f | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | g | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | h | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | i | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | j | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | k | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | l | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | m | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | n | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | o | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | p | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | q | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | r | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | s | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | t | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | u | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | v | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | w | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | x | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | y | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | z | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | a1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | b1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | c1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | h1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | j1 | | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | k1 | | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l1 | | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | m1 | | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | n1 | | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o1 | | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | p1 | | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | q1 | | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r1 | | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | s1 | | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | t1 | | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | u1 | | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v1 | | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | w1 | | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | x1 | | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | y1 | | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | z1 | | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a2 | | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b2 | | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c2 | | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | d2 | | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e2 | | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | f2 | | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | g2 | | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | h2 | | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i2 | | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | j2 | | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | k2 | #)
+ | (# | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | l2 #)
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout
=====================================
@@ -256,6 +256,13 @@ module Data.Sum.Experimental where
(n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49) (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52)
(bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62).
Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk #)
+ forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep) (k16 :: GHC.Internal.Types.RuntimeRep)
+ (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep) (k33 :: GHC.Internal.Types.RuntimeRep)
+ (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep) (k50 :: GHC.Internal.Types.RuntimeRep)
+ (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep) (a :: TYPE k0) (b :: TYPE k1) (c :: TYPE k2) (d :: TYPE k3) (e :: TYPE k4) (f :: TYPE k5) (g :: TYPE k6) (h :: TYPE k7) (i :: TYPE k8) (j :: TYPE k9)
+ (k :: TYPE k10) (l :: TYPE k11) (m :: TYPE k12) (n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49)
+ (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52) (bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62) (bl :: TYPE k63).
+ Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk | bl #)
type Sum10# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9])
data Sum10# a b c d e f g h i j = ...
type Sum11# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE k10 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10])
@@ -1791,6 +1798,76 @@ module Data.Sum.Experimental where
-> TYPE k62
-> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62])
data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 = ...
+ type Sum64# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep)
+ (k16 :: GHC.Internal.Types.RuntimeRep) (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep)
+ (k33 :: GHC.Internal.Types.RuntimeRep) (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep)
+ (k50 :: GHC.Internal.Types.RuntimeRep) (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep).
+ TYPE k0
+ -> TYPE k1
+ -> TYPE k2
+ -> TYPE k3
+ -> TYPE k4
+ -> TYPE k5
+ -> TYPE k6
+ -> TYPE k7
+ -> TYPE k8
+ -> TYPE k9
+ -> TYPE k10
+ -> TYPE k11
+ -> TYPE k12
+ -> TYPE k13
+ -> TYPE k14
+ -> TYPE k15
+ -> TYPE k16
+ -> TYPE k17
+ -> TYPE k18
+ -> TYPE k19
+ -> TYPE k20
+ -> TYPE k21
+ -> TYPE k22
+ -> TYPE k23
+ -> TYPE k24
+ -> TYPE k25
+ -> TYPE k26
+ -> TYPE k27
+ -> TYPE k28
+ -> TYPE k29
+ -> TYPE k30
+ -> TYPE k31
+ -> TYPE k32
+ -> TYPE k33
+ -> TYPE k34
+ -> TYPE k35
+ -> TYPE k36
+ -> TYPE k37
+ -> TYPE k38
+ -> TYPE k39
+ -> TYPE k40
+ -> TYPE k41
+ -> TYPE k42
+ -> TYPE k43
+ -> TYPE k44
+ -> TYPE k45
+ -> TYPE k46
+ -> TYPE k47
+ -> TYPE k48
+ -> TYPE k49
+ -> TYPE k50
+ -> TYPE k51
+ -> TYPE k52
+ -> TYPE k53
+ -> TYPE k54
+ -> TYPE k55
+ -> TYPE k56
+ -> TYPE k57
+ -> TYPE k58
+ -> TYPE k59
+ -> TYPE k60
+ -> TYPE k61
+ -> TYPE k62
+ -> TYPE k63
+ -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63])
+ data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 = ...
type Sum7# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6])
data Sum7# a b c d e f g = ...
type Sum8# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7])
@@ -9573,6 +9650,13 @@ module Prelude.Experimental where
(n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49) (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52)
(bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62).
Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk #)
+ forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep) (k16 :: GHC.Internal.Types.RuntimeRep)
+ (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep) (k33 :: GHC.Internal.Types.RuntimeRep)
+ (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep) (k50 :: GHC.Internal.Types.RuntimeRep)
+ (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep) (a :: TYPE k0) (b :: TYPE k1) (c :: TYPE k2) (d :: TYPE k3) (e :: TYPE k4) (f :: TYPE k5) (g :: TYPE k6) (h :: TYPE k7) (i :: TYPE k8) (j :: TYPE k9)
+ (k :: TYPE k10) (l :: TYPE k11) (m :: TYPE k12) (n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49)
+ (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52) (bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62) (bl :: TYPE k63).
+ Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk | bl #)
type Sum10# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9])
data Sum10# a b c d e f g h i j = ...
type Sum11# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE k10 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10])
@@ -11108,6 +11192,76 @@ module Prelude.Experimental where
-> TYPE k62
-> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62])
data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 = ...
+ type Sum64# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep)
+ (k16 :: GHC.Internal.Types.RuntimeRep) (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep)
+ (k33 :: GHC.Internal.Types.RuntimeRep) (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep)
+ (k50 :: GHC.Internal.Types.RuntimeRep) (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep).
+ TYPE k0
+ -> TYPE k1
+ -> TYPE k2
+ -> TYPE k3
+ -> TYPE k4
+ -> TYPE k5
+ -> TYPE k6
+ -> TYPE k7
+ -> TYPE k8
+ -> TYPE k9
+ -> TYPE k10
+ -> TYPE k11
+ -> TYPE k12
+ -> TYPE k13
+ -> TYPE k14
+ -> TYPE k15
+ -> TYPE k16
+ -> TYPE k17
+ -> TYPE k18
+ -> TYPE k19
+ -> TYPE k20
+ -> TYPE k21
+ -> TYPE k22
+ -> TYPE k23
+ -> TYPE k24
+ -> TYPE k25
+ -> TYPE k26
+ -> TYPE k27
+ -> TYPE k28
+ -> TYPE k29
+ -> TYPE k30
+ -> TYPE k31
+ -> TYPE k32
+ -> TYPE k33
+ -> TYPE k34
+ -> TYPE k35
+ -> TYPE k36
+ -> TYPE k37
+ -> TYPE k38
+ -> TYPE k39
+ -> TYPE k40
+ -> TYPE k41
+ -> TYPE k42
+ -> TYPE k43
+ -> TYPE k44
+ -> TYPE k45
+ -> TYPE k46
+ -> TYPE k47
+ -> TYPE k48
+ -> TYPE k49
+ -> TYPE k50
+ -> TYPE k51
+ -> TYPE k52
+ -> TYPE k53
+ -> TYPE k54
+ -> TYPE k55
+ -> TYPE k56
+ -> TYPE k57
+ -> TYPE k58
+ -> TYPE k59
+ -> TYPE k60
+ -> TYPE k61
+ -> TYPE k62
+ -> TYPE k63
+ -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63])
+ data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 = ...
type Sum7# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6])
data Sum7# a b c d e f g = ...
type Sum8# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7])
=====================================
testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
=====================================
@@ -256,6 +256,13 @@ module Data.Sum.Experimental where
(n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49) (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52)
(bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62).
Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk #)
+ forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep) (k16 :: GHC.Internal.Types.RuntimeRep)
+ (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep) (k33 :: GHC.Internal.Types.RuntimeRep)
+ (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep) (k50 :: GHC.Internal.Types.RuntimeRep)
+ (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep) (a :: TYPE k0) (b :: TYPE k1) (c :: TYPE k2) (d :: TYPE k3) (e :: TYPE k4) (f :: TYPE k5) (g :: TYPE k6) (h :: TYPE k7) (i :: TYPE k8) (j :: TYPE k9)
+ (k :: TYPE k10) (l :: TYPE k11) (m :: TYPE k12) (n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49)
+ (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52) (bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62) (bl :: TYPE k63).
+ Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk | bl #)
type Sum10# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9])
data Sum10# a b c d e f g h i j = ...
type Sum11# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE k10 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10])
@@ -1791,6 +1798,76 @@ module Data.Sum.Experimental where
-> TYPE k62
-> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62])
data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 = ...
+ type Sum64# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep)
+ (k16 :: GHC.Internal.Types.RuntimeRep) (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep)
+ (k33 :: GHC.Internal.Types.RuntimeRep) (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep)
+ (k50 :: GHC.Internal.Types.RuntimeRep) (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep).
+ TYPE k0
+ -> TYPE k1
+ -> TYPE k2
+ -> TYPE k3
+ -> TYPE k4
+ -> TYPE k5
+ -> TYPE k6
+ -> TYPE k7
+ -> TYPE k8
+ -> TYPE k9
+ -> TYPE k10
+ -> TYPE k11
+ -> TYPE k12
+ -> TYPE k13
+ -> TYPE k14
+ -> TYPE k15
+ -> TYPE k16
+ -> TYPE k17
+ -> TYPE k18
+ -> TYPE k19
+ -> TYPE k20
+ -> TYPE k21
+ -> TYPE k22
+ -> TYPE k23
+ -> TYPE k24
+ -> TYPE k25
+ -> TYPE k26
+ -> TYPE k27
+ -> TYPE k28
+ -> TYPE k29
+ -> TYPE k30
+ -> TYPE k31
+ -> TYPE k32
+ -> TYPE k33
+ -> TYPE k34
+ -> TYPE k35
+ -> TYPE k36
+ -> TYPE k37
+ -> TYPE k38
+ -> TYPE k39
+ -> TYPE k40
+ -> TYPE k41
+ -> TYPE k42
+ -> TYPE k43
+ -> TYPE k44
+ -> TYPE k45
+ -> TYPE k46
+ -> TYPE k47
+ -> TYPE k48
+ -> TYPE k49
+ -> TYPE k50
+ -> TYPE k51
+ -> TYPE k52
+ -> TYPE k53
+ -> TYPE k54
+ -> TYPE k55
+ -> TYPE k56
+ -> TYPE k57
+ -> TYPE k58
+ -> TYPE k59
+ -> TYPE k60
+ -> TYPE k61
+ -> TYPE k62
+ -> TYPE k63
+ -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63])
+ data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 = ...
type Sum7# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6])
data Sum7# a b c d e f g = ...
type Sum8# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7])
@@ -9576,6 +9653,13 @@ module Prelude.Experimental where
(n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49) (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52)
(bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62).
Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk #)
+ forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep) (k16 :: GHC.Internal.Types.RuntimeRep)
+ (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep) (k33 :: GHC.Internal.Types.RuntimeRep)
+ (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep) (k50 :: GHC.Internal.Types.RuntimeRep)
+ (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep) (a :: TYPE k0) (b :: TYPE k1) (c :: TYPE k2) (d :: TYPE k3) (e :: TYPE k4) (f :: TYPE k5) (g :: TYPE k6) (h :: TYPE k7) (i :: TYPE k8) (j :: TYPE k9)
+ (k :: TYPE k10) (l :: TYPE k11) (m :: TYPE k12) (n :: TYPE k13) (o :: TYPE k14) (p :: TYPE k15) (q :: TYPE k16) (r :: TYPE k17) (s :: TYPE k18) (t :: TYPE k19) (u :: TYPE k20) (v :: TYPE k21) (w :: TYPE k22) (x :: TYPE k23) (y :: TYPE k24) (z :: TYPE k25) (aa :: TYPE k26) (ab :: TYPE k27) (ac :: TYPE k28) (ad :: TYPE k29) (ae :: TYPE k30) (af :: TYPE k31) (ag :: TYPE k32) (ah :: TYPE k33) (ai :: TYPE k34) (aj :: TYPE k35) (ak :: TYPE k36) (al :: TYPE k37) (am :: TYPE k38) (an :: TYPE k39) (ao :: TYPE k40) (ap :: TYPE k41) (aq :: TYPE k42) (ar :: TYPE k43) (as :: TYPE k44) (at :: TYPE k45) (au :: TYPE k46) (av :: TYPE k47) (aw :: TYPE k48) (ax :: TYPE k49)
+ (ay :: TYPE k50) (az :: TYPE k51) (ba :: TYPE k52) (bb :: TYPE k53) (bc :: TYPE k54) (bd :: TYPE k55) (be :: TYPE k56) (bf :: TYPE k57) (bg :: TYPE k58) (bh :: TYPE k59) (bi :: TYPE k60) (bj :: TYPE k61) (bk :: TYPE k62) (bl :: TYPE k63).
+ Sum# '(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl) = (# a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z | aa | ab | ac | ad | ae | af | ag | ah | ai | aj | ak | al | am | an | ao | ap | aq | ar | as | at | au | av | aw | ax | ay | az | ba | bb | bc | bd | be | bf | bg | bh | bi | bj | bk | bl #)
type Sum10# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9])
data Sum10# a b c d e f g h i j = ...
type Sum11# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE k8 -> TYPE k9 -> TYPE k10 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10])
@@ -11111,6 +11195,76 @@ module Prelude.Experimental where
-> TYPE k62
-> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62])
data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 = ...
+ type Sum64# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep) (k8 :: GHC.Internal.Types.RuntimeRep) (k9 :: GHC.Internal.Types.RuntimeRep) (k10 :: GHC.Internal.Types.RuntimeRep) (k11 :: GHC.Internal.Types.RuntimeRep) (k12 :: GHC.Internal.Types.RuntimeRep) (k13 :: GHC.Internal.Types.RuntimeRep) (k14 :: GHC.Internal.Types.RuntimeRep) (k15 :: GHC.Internal.Types.RuntimeRep)
+ (k16 :: GHC.Internal.Types.RuntimeRep) (k17 :: GHC.Internal.Types.RuntimeRep) (k18 :: GHC.Internal.Types.RuntimeRep) (k19 :: GHC.Internal.Types.RuntimeRep) (k20 :: GHC.Internal.Types.RuntimeRep) (k21 :: GHC.Internal.Types.RuntimeRep) (k22 :: GHC.Internal.Types.RuntimeRep) (k23 :: GHC.Internal.Types.RuntimeRep) (k24 :: GHC.Internal.Types.RuntimeRep) (k25 :: GHC.Internal.Types.RuntimeRep) (k26 :: GHC.Internal.Types.RuntimeRep) (k27 :: GHC.Internal.Types.RuntimeRep) (k28 :: GHC.Internal.Types.RuntimeRep) (k29 :: GHC.Internal.Types.RuntimeRep) (k30 :: GHC.Internal.Types.RuntimeRep) (k31 :: GHC.Internal.Types.RuntimeRep) (k32 :: GHC.Internal.Types.RuntimeRep)
+ (k33 :: GHC.Internal.Types.RuntimeRep) (k34 :: GHC.Internal.Types.RuntimeRep) (k35 :: GHC.Internal.Types.RuntimeRep) (k36 :: GHC.Internal.Types.RuntimeRep) (k37 :: GHC.Internal.Types.RuntimeRep) (k38 :: GHC.Internal.Types.RuntimeRep) (k39 :: GHC.Internal.Types.RuntimeRep) (k40 :: GHC.Internal.Types.RuntimeRep) (k41 :: GHC.Internal.Types.RuntimeRep) (k42 :: GHC.Internal.Types.RuntimeRep) (k43 :: GHC.Internal.Types.RuntimeRep) (k44 :: GHC.Internal.Types.RuntimeRep) (k45 :: GHC.Internal.Types.RuntimeRep) (k46 :: GHC.Internal.Types.RuntimeRep) (k47 :: GHC.Internal.Types.RuntimeRep) (k48 :: GHC.Internal.Types.RuntimeRep) (k49 :: GHC.Internal.Types.RuntimeRep)
+ (k50 :: GHC.Internal.Types.RuntimeRep) (k51 :: GHC.Internal.Types.RuntimeRep) (k52 :: GHC.Internal.Types.RuntimeRep) (k53 :: GHC.Internal.Types.RuntimeRep) (k54 :: GHC.Internal.Types.RuntimeRep) (k55 :: GHC.Internal.Types.RuntimeRep) (k56 :: GHC.Internal.Types.RuntimeRep) (k57 :: GHC.Internal.Types.RuntimeRep) (k58 :: GHC.Internal.Types.RuntimeRep) (k59 :: GHC.Internal.Types.RuntimeRep) (k60 :: GHC.Internal.Types.RuntimeRep) (k61 :: GHC.Internal.Types.RuntimeRep) (k62 :: GHC.Internal.Types.RuntimeRep) (k63 :: GHC.Internal.Types.RuntimeRep).
+ TYPE k0
+ -> TYPE k1
+ -> TYPE k2
+ -> TYPE k3
+ -> TYPE k4
+ -> TYPE k5
+ -> TYPE k6
+ -> TYPE k7
+ -> TYPE k8
+ -> TYPE k9
+ -> TYPE k10
+ -> TYPE k11
+ -> TYPE k12
+ -> TYPE k13
+ -> TYPE k14
+ -> TYPE k15
+ -> TYPE k16
+ -> TYPE k17
+ -> TYPE k18
+ -> TYPE k19
+ -> TYPE k20
+ -> TYPE k21
+ -> TYPE k22
+ -> TYPE k23
+ -> TYPE k24
+ -> TYPE k25
+ -> TYPE k26
+ -> TYPE k27
+ -> TYPE k28
+ -> TYPE k29
+ -> TYPE k30
+ -> TYPE k31
+ -> TYPE k32
+ -> TYPE k33
+ -> TYPE k34
+ -> TYPE k35
+ -> TYPE k36
+ -> TYPE k37
+ -> TYPE k38
+ -> TYPE k39
+ -> TYPE k40
+ -> TYPE k41
+ -> TYPE k42
+ -> TYPE k43
+ -> TYPE k44
+ -> TYPE k45
+ -> TYPE k46
+ -> TYPE k47
+ -> TYPE k48
+ -> TYPE k49
+ -> TYPE k50
+ -> TYPE k51
+ -> TYPE k52
+ -> TYPE k53
+ -> TYPE k54
+ -> TYPE k55
+ -> TYPE k56
+ -> TYPE k57
+ -> TYPE k58
+ -> TYPE k59
+ -> TYPE k60
+ -> TYPE k61
+ -> TYPE k62
+ -> TYPE k63
+ -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63])
+ data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 = ...
type Sum7# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6])
data Sum7# a b c d e f g = ...
type Sum8# :: forall (k0 :: GHC.Internal.Types.RuntimeRep) (k1 :: GHC.Internal.Types.RuntimeRep) (k2 :: GHC.Internal.Types.RuntimeRep) (k3 :: GHC.Internal.Types.RuntimeRep) (k4 :: GHC.Internal.Types.RuntimeRep) (k5 :: GHC.Internal.Types.RuntimeRep) (k6 :: GHC.Internal.Types.RuntimeRep) (k7 :: GHC.Internal.Types.RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE (GHC.Internal.Types.SumRep [k0, k1, k2, k3, k4, k5, k6, k7])
=====================================
testsuite/tests/interface-stability/ghc-prim-exports.stdout
=====================================
@@ -5373,6 +5373,74 @@ module GHC.Types where
-> TYPE k62
-> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62])
data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 = ...
+ type Sum64# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (k2 :: RuntimeRep) (k3 :: RuntimeRep) (k4 :: RuntimeRep) (k5 :: RuntimeRep) (k6 :: RuntimeRep) (k7 :: RuntimeRep) (k8 :: RuntimeRep) (k9 :: RuntimeRep) (k10 :: RuntimeRep) (k11 :: RuntimeRep) (k12 :: RuntimeRep) (k13 :: RuntimeRep) (k14 :: RuntimeRep) (k15 :: RuntimeRep) (k16 :: RuntimeRep) (k17 :: RuntimeRep) (k18 :: RuntimeRep) (k19 :: RuntimeRep) (k20 :: RuntimeRep) (k21 :: RuntimeRep) (k22 :: RuntimeRep) (k23 :: RuntimeRep) (k24 :: RuntimeRep) (k25 :: RuntimeRep) (k26 :: RuntimeRep) (k27 :: RuntimeRep) (k28 :: RuntimeRep) (k29 :: RuntimeRep) (k30 :: RuntimeRep) (k31 :: RuntimeRep)
+ (k32 :: RuntimeRep) (k33 :: RuntimeRep) (k34 :: RuntimeRep) (k35 :: RuntimeRep) (k36 :: RuntimeRep) (k37 :: RuntimeRep) (k38 :: RuntimeRep) (k39 :: RuntimeRep) (k40 :: RuntimeRep) (k41 :: RuntimeRep) (k42 :: RuntimeRep) (k43 :: RuntimeRep) (k44 :: RuntimeRep) (k45 :: RuntimeRep) (k46 :: RuntimeRep) (k47 :: RuntimeRep) (k48 :: RuntimeRep) (k49 :: RuntimeRep) (k50 :: RuntimeRep) (k51 :: RuntimeRep) (k52 :: RuntimeRep) (k53 :: RuntimeRep) (k54 :: RuntimeRep) (k55 :: RuntimeRep) (k56 :: RuntimeRep) (k57 :: RuntimeRep) (k58 :: RuntimeRep) (k59 :: RuntimeRep) (k60 :: RuntimeRep) (k61 :: RuntimeRep) (k62 :: RuntimeRep) (k63 :: RuntimeRep).
+ TYPE k0
+ -> TYPE k1
+ -> TYPE k2
+ -> TYPE k3
+ -> TYPE k4
+ -> TYPE k5
+ -> TYPE k6
+ -> TYPE k7
+ -> TYPE k8
+ -> TYPE k9
+ -> TYPE k10
+ -> TYPE k11
+ -> TYPE k12
+ -> TYPE k13
+ -> TYPE k14
+ -> TYPE k15
+ -> TYPE k16
+ -> TYPE k17
+ -> TYPE k18
+ -> TYPE k19
+ -> TYPE k20
+ -> TYPE k21
+ -> TYPE k22
+ -> TYPE k23
+ -> TYPE k24
+ -> TYPE k25
+ -> TYPE k26
+ -> TYPE k27
+ -> TYPE k28
+ -> TYPE k29
+ -> TYPE k30
+ -> TYPE k31
+ -> TYPE k32
+ -> TYPE k33
+ -> TYPE k34
+ -> TYPE k35
+ -> TYPE k36
+ -> TYPE k37
+ -> TYPE k38
+ -> TYPE k39
+ -> TYPE k40
+ -> TYPE k41
+ -> TYPE k42
+ -> TYPE k43
+ -> TYPE k44
+ -> TYPE k45
+ -> TYPE k46
+ -> TYPE k47
+ -> TYPE k48
+ -> TYPE k49
+ -> TYPE k50
+ -> TYPE k51
+ -> TYPE k52
+ -> TYPE k53
+ -> TYPE k54
+ -> TYPE k55
+ -> TYPE k56
+ -> TYPE k57
+ -> TYPE k58
+ -> TYPE k59
+ -> TYPE k60
+ -> TYPE k61
+ -> TYPE k62
+ -> TYPE k63
+ -> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63])
+ data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 = ...
type Sum7# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (k2 :: RuntimeRep) (k3 :: RuntimeRep) (k4 :: RuntimeRep) (k5 :: RuntimeRep) (k6 :: RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6])
data Sum7# a b c d e f g = ...
type Sum8# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (k2 :: RuntimeRep) (k3 :: RuntimeRep) (k4 :: RuntimeRep) (k5 :: RuntimeRep) (k6 :: RuntimeRep) (k7 :: RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6, k7])
=====================================
testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
=====================================
@@ -5376,6 +5376,74 @@ module GHC.Types where
-> TYPE k62
-> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62])
data Sum63# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 = ...
+ type Sum64# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (k2 :: RuntimeRep) (k3 :: RuntimeRep) (k4 :: RuntimeRep) (k5 :: RuntimeRep) (k6 :: RuntimeRep) (k7 :: RuntimeRep) (k8 :: RuntimeRep) (k9 :: RuntimeRep) (k10 :: RuntimeRep) (k11 :: RuntimeRep) (k12 :: RuntimeRep) (k13 :: RuntimeRep) (k14 :: RuntimeRep) (k15 :: RuntimeRep) (k16 :: RuntimeRep) (k17 :: RuntimeRep) (k18 :: RuntimeRep) (k19 :: RuntimeRep) (k20 :: RuntimeRep) (k21 :: RuntimeRep) (k22 :: RuntimeRep) (k23 :: RuntimeRep) (k24 :: RuntimeRep) (k25 :: RuntimeRep) (k26 :: RuntimeRep) (k27 :: RuntimeRep) (k28 :: RuntimeRep) (k29 :: RuntimeRep) (k30 :: RuntimeRep) (k31 :: RuntimeRep)
+ (k32 :: RuntimeRep) (k33 :: RuntimeRep) (k34 :: RuntimeRep) (k35 :: RuntimeRep) (k36 :: RuntimeRep) (k37 :: RuntimeRep) (k38 :: RuntimeRep) (k39 :: RuntimeRep) (k40 :: RuntimeRep) (k41 :: RuntimeRep) (k42 :: RuntimeRep) (k43 :: RuntimeRep) (k44 :: RuntimeRep) (k45 :: RuntimeRep) (k46 :: RuntimeRep) (k47 :: RuntimeRep) (k48 :: RuntimeRep) (k49 :: RuntimeRep) (k50 :: RuntimeRep) (k51 :: RuntimeRep) (k52 :: RuntimeRep) (k53 :: RuntimeRep) (k54 :: RuntimeRep) (k55 :: RuntimeRep) (k56 :: RuntimeRep) (k57 :: RuntimeRep) (k58 :: RuntimeRep) (k59 :: RuntimeRep) (k60 :: RuntimeRep) (k61 :: RuntimeRep) (k62 :: RuntimeRep) (k63 :: RuntimeRep).
+ TYPE k0
+ -> TYPE k1
+ -> TYPE k2
+ -> TYPE k3
+ -> TYPE k4
+ -> TYPE k5
+ -> TYPE k6
+ -> TYPE k7
+ -> TYPE k8
+ -> TYPE k9
+ -> TYPE k10
+ -> TYPE k11
+ -> TYPE k12
+ -> TYPE k13
+ -> TYPE k14
+ -> TYPE k15
+ -> TYPE k16
+ -> TYPE k17
+ -> TYPE k18
+ -> TYPE k19
+ -> TYPE k20
+ -> TYPE k21
+ -> TYPE k22
+ -> TYPE k23
+ -> TYPE k24
+ -> TYPE k25
+ -> TYPE k26
+ -> TYPE k27
+ -> TYPE k28
+ -> TYPE k29
+ -> TYPE k30
+ -> TYPE k31
+ -> TYPE k32
+ -> TYPE k33
+ -> TYPE k34
+ -> TYPE k35
+ -> TYPE k36
+ -> TYPE k37
+ -> TYPE k38
+ -> TYPE k39
+ -> TYPE k40
+ -> TYPE k41
+ -> TYPE k42
+ -> TYPE k43
+ -> TYPE k44
+ -> TYPE k45
+ -> TYPE k46
+ -> TYPE k47
+ -> TYPE k48
+ -> TYPE k49
+ -> TYPE k50
+ -> TYPE k51
+ -> TYPE k52
+ -> TYPE k53
+ -> TYPE k54
+ -> TYPE k55
+ -> TYPE k56
+ -> TYPE k57
+ -> TYPE k58
+ -> TYPE k59
+ -> TYPE k60
+ -> TYPE k61
+ -> TYPE k62
+ -> TYPE k63
+ -> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63])
+ data Sum64# a b c d e f g h i j k l m n o p q r s t u v w x y z t26 t27 t28 t29 t30 t31 t32 t33 t34 t35 t36 t37 t38 t39 t40 t41 t42 t43 t44 t45 t46 t47 t48 t49 t50 t51 t52 t53 t54 t55 t56 t57 t58 t59 t60 t61 t62 t63 = ...
type Sum7# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (k2 :: RuntimeRep) (k3 :: RuntimeRep) (k4 :: RuntimeRep) (k5 :: RuntimeRep) (k6 :: RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6])
data Sum7# a b c d e f g = ...
type Sum8# :: forall (k0 :: RuntimeRep) (k1 :: RuntimeRep) (k2 :: RuntimeRep) (k3 :: RuntimeRep) (k4 :: RuntimeRep) (k5 :: RuntimeRep) (k6 :: RuntimeRep) (k7 :: RuntimeRep). TYPE k0 -> TYPE k1 -> TYPE k2 -> TYPE k3 -> TYPE k4 -> TYPE k5 -> TYPE k6 -> TYPE k7 -> TYPE (SumRep [k0, k1, k2, k3, k4, k5, k6, k7])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/baed06c1fbea98d5fb1cec9d22c7084…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/baed06c1fbea98d5fb1cec9d22c7084…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/interpolated-strings] Implement interpolated strings
by Brandon Chinn (@brandonchinn178) 05 May '26
by Brandon Chinn (@brandonchinn178) 05 May '26
05 May '26
Brandon Chinn pushed to branch wip/interpolated-strings at Glasgow Haskell Compiler / GHC
Commits:
e03855c6 by Brandon Chinn at 2026-05-05T13:04:13-07:00
Implement interpolated strings
- - - - -
72 changed files:
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.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/Lexer/String.x
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Pat.hs
- + compiler/GHC/Rename/String.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/ghc.cabal.in
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-experimental/ghc-experimental.cabal.in
- + libraries/ghc-experimental/src/Data/String/Interpolate/Experimental.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Data/Data.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/Lift.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- libraries/ghci/GHCi/TH/Binary.hs
- libraries/template-haskell/Language/Haskell/TH/Lib.hs
- testsuite/tests/driver/T4437.hs
- + testsuite/tests/parser/should_fail/MultilineStringsEscapeOverflow.hs
- + testsuite/tests/parser/should_fail/MultilineStringsEscapeOverflow.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationEscapeOverflow.hs
- + testsuite/tests/parser/should_fail/StringInterpolationEscapeOverflow.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationExtraOpen.hs
- + testsuite/tests/parser/should_fail/StringInterpolationExtraOpen.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationInPat.hs
- + testsuite/tests/parser/should_fail/StringInterpolationInPat.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationInType.hs
- + testsuite/tests/parser/should_fail/StringInterpolationInType.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationIncompleteExpr.hs
- + testsuite/tests/parser/should_fail/StringInterpolationIncompleteExpr.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationInvalidExpr.hs
- + testsuite/tests/parser/should_fail/StringInterpolationInvalidExpr.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationLineComment.hs
- + testsuite/tests/parser/should_fail/StringInterpolationLineComment.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationNoDelimClose.hs
- + testsuite/tests/parser/should_fail/StringInterpolationNoDelimClose.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationNoExpr.hs
- + testsuite/tests/parser/should_fail/StringInterpolationNoExpr.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationNoExprClose.hs
- + testsuite/tests/parser/should_fail/StringInterpolationNoExprClose.stderr
- testsuite/tests/parser/should_fail/all.T
- + testsuite/tests/parser/should_run/StringInterpolation.hs
- + testsuite/tests/parser/should_run/StringInterpolation.stdout
- + testsuite/tests/parser/should_run/StringInterpolationOverloaded.hs
- + testsuite/tests/parser/should_run/StringInterpolationOverloaded.stdout
- testsuite/tests/parser/should_run/all.T
- + testsuite/tests/qualified-strings/should_run/Example/SQL.hs
- testsuite/tests/qualified-strings/should_run/all.T
- + testsuite/tests/qualified-strings/should_run/qstrings_interpolation.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_interpolation.stdout
- 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/-/commit/e03855c6b572315436f5db058b9a669…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e03855c6b572315436f5db058b9a669…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/interpolated-strings] 57 commits: Simplify mkTick
by Brandon Chinn (@brandonchinn178) 05 May '26
by Brandon Chinn (@brandonchinn178) 05 May '26
05 May '26
Brandon Chinn pushed to branch wip/interpolated-strings at Glasgow Haskell Compiler / GHC
Commits:
2dadf3b0 by sheaf at 2026-04-16T13:28:39-04:00
Simplify mkTick
This commit simplifies 'GHC.Core.Utils.mkTick', removing the
accumulating parameter 'rest' which was suspiciously treating a bunch of
different ticks as a group, and moving the group as a whole around the
AST, ignoring that the ticks in the group might have different placement
properties.
The most important change is that we revert the logic (added in 85b0aae2)
that allowed ticks to be placed around coercions, which caused serious
issues (e.g. #27121). It was just a mistake, as it doesn't make sense
to put a tick around a coercion.
Also adds Note [Pushing SCCs inwards] which clarifies the logic for
pushing SCCs into lambdas, constructor applications, and dropping SCCs
around non-function variables (in particular the treatment of splittable
ticks).
A few other changes are also implemented:
- simplify 'can_split' predicate (no functional change)
- combine profiling ticks into one when possible
Fixes #26878, #26941 and #27121
Co-authored-by: simonpj <simon.peytonjones(a)gmail.com>
- - - - -
a0d6f1f4 by Simon Jakobi at 2026-04-16T13:29:28-04:00
Add regression test for #9074
Closes #9074.
- - - - -
d178ee89 by Sylvain Henry at 2026-04-16T13:30:25-04:00
Add changelog for #15973
- - - - -
e8a196c6 by sheaf at 2026-04-16T13:31:19-04:00
Deal with 'noSpec' in 'coreExprToPmLit'
This commit makes two separate changes relating to
'GHC.HsToCore.Pmc.Solver.Types.coreExprAsPmLit':
1. Commit 7124e4ad mistakenly marked deferred errors as non-canonical,
which led to the introduction of 'nospec' wrappers in the
generated Core. This reverts that accident by declaring deferred
errors as being canonical, avoiding spurious 'nospec' wrapping.
2. Look through magic identity-like Ids such as 'nospec', 'inline' and
'lazy' in 'coreExprAsPmLit', just like Core Prep does.
There might genuinely be incoherent evidence, but that shouldn't
obstruct the pattern match checker. See test T27124a.
Fixes #25926 #27124
-------------------------
Metric Decrease:
T3294
-------------------------
- - - - -
8cb99552 by Sylvain Henry at 2026-04-16T19:22:43-04:00
hadrian: warn when package index is missing (#16484)
Since cabal-install 3.0 we can query the path of remote-repo-cache and
check if hackage package index is present.
Fixes #16484
- - - - -
d6ce7477 by Richard Eisenberg at 2026-04-16T19:23:25-04:00
Teach hadrian to --skip-test.
Fixes #27188.
This adds the --skip-test flag to `hadrian build`, as documented in the
patch.
- - - - -
7666f4a9 by Fendor at 2026-04-17T22:29:51-04:00
Migrate `ghc-pkg` to use `OsPath` and `file-io`
`ghc-pkg` should use UNC paths as much as possible to avoid MAX_PATH
issues on windows.
`file-io` uses UNC Paths by default on windows, ensuring we use the
correct APIs and that we finally are no longer plagued by MAX_PATH
issues in CI and private machines.
On top of it, the higher correctness of `OsPath` is appreciated in this
small codebase. Also, we improve memory usage very slightly, due to the
more efficient memory representation of `OsPath` over `FilePath`
Adds `ghc-pkg` regression test for MAX_PATH on windows
Make sure `ghc-pkg` behaves as expected when long paths (> 255) are
involved on windows.
Let's generate a testcase where we can actually observe that `ghc-pkg`
behaves as epxected.
See the documentation for windows on Maximum Path Length Limitation:
* `https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation`
Adds changelog entry for long path support in ghc-pkg.
- - - - -
78434e8c by Simon Peyton Jones at 2026-04-17T22:30:38-04:00
Kill off the substitution in Lint
Now that we have invariant (NoTypeShadowing) we no longer
need Lint to carry an ambient substitution. This makes it
simpler and faster. A really worthwhile refactor.
There are some knock-on effects
* Linting join points after worker/wrapper. See
Note [Join points and beta redexes]
* Running a type substitution after the desugarer.
See Note [Substituting type-lets] in
the new module GHC.Core.SubstTypeLets
Implements #27078
Most perf tests don't use Lint so we won't see a perf incresae.
But T1969, which uses -O0 and Lint, gets 1.3% worse because it has
to run the SubstTypeLets pass which is a somewhat expensive no-op
Overall though compile-time allocations are down 0.1%.
Metric Increase:
T1969
- - - - -
86ca6c2c by mangoiv at 2026-04-17T22:31:22-04:00
testsuite: inline elemCoreTest
Some weird (probably python scoping) rule caused elemCoreTest, a regex
being out of scope on ubuntu, presumably because of a newer python version.
This patch just inlines the regex, which fixes the issue.
Fixes #27193
- - - - -
72d6dc74 by aparker at 2026-04-20T20:15:44-04:00
NCG: Implement constant folding for vector simd ops (Issue #25030)
- - - - -
b9cab907 by sheaf at 2026-04-20T20:15:44-04:00
Mark some SIMD tests as broken on i386 optllvm
As seen in #25498, several SIMD tests are broken on i386 in the optllvm
way. This commit marks them as "expect_broken".
- - - - -
76528cc3 by Wolfgang Jeltsch at 2026-04-20T20:16:25-04:00
Move most of the `System.IO` implementation into `base`
This involves a rewrite of the `combine` helper function to avoid the
use of `last`, which would now be flagged as an error.
Metric Decrease:
LinkableUsage01
T3294
Metric Increase:
T12227
T12707
T5642
- - - - -
04d143c0 by Luite Stegeman at 2026-04-21T14:05:33-04:00
rts: add a few missing i386 relocations in the rts linker
- - - - -
014087e7 by Luite Stegeman at 2026-04-21T14:05:34-04:00
CodeOutput: Fix finalizers on multiple platforms
- ELF platforms: emit .fini_array section
- wasm32/Darwin: emit initializer with __cxa_atexit call
- Windows: use -Wl,--whole-archive to prevent dropping finalizer symbols
- rts linker: fix crash/assertion failure unloading objects with finalizers
fixes #27072
- - - - -
915bba6f by Simon Jakobi at 2026-04-21T14:06:16-04:00
Add regression test for #10531
Closes #10531.
- - - - -
86a646a6 by Andreas Klebinger at 2026-04-22T13:00:05-04:00
Revert use of generic instances for compiler time perf reasons.
Revert "Derive Semigroup/Monoid for instances believed could be derived in #25871"
This reverts commit 11a04cbb221cc404fe00d65d7c951558ede4caa9.
Revert "add Ghc.Data.Pair deriving"
This reverts commit 15d9ce449e1be8c01b89fd39bdf1e700ea7d1dce.
- - - - -
bc9ee1cf by Wen Kokke at 2026-04-22T13:00:51-04:00
hadrian: Fix docs to remove static flavour
In 638f6548, the static flavour was turned into into the fully_static
flavour transformer. However, this commit did not update flavours.md.
- - - - -
cc9cc6d5 by Cheng Shao at 2026-04-23T09:40:46+00:00
configure: bump LlvmMaxVersion to 23
This patch bumps `LlvmMaxVersion` to 23 to support LLVM 22.x releases.
- - - - -
2ea7ef8e by Cheng Shao at 2026-04-23T09:46:26+00:00
changelog: add llvm 22.x support
- - - - -
5574ee10 by Cheng Shao at 2026-04-24T08:24:30-04:00
compiler: avoid unused temporary `appendFS` operands
This patch fixes unused temporary `appendFS` operands in the codebase
that are retained in the `FastString` table after concatenation.
Rewrite rules are added so that if an operand is
`fsLit`/`mkFastString`, the `appendFS` application is rewritten to
append the `ShortByteString` operands first. The patch also fixes
`sconcat` behavior to align with `mconcat` for the same reason. Fixes #27205.
- - - - -
4ed78760 by mangoiv at 2026-04-24T08:25:13-04:00
contributing: adjust MR template to be less verbose
- MR template only shows text that is relevant for submissiong
- MR template was rewritten so it's readable from a user's and reviewer's
perspective
Resolves #27165
Co-Authored-By: @sheaf
- - - - -
87db83e2 by Cheng Shao at 2026-04-24T14:37:21-04:00
ci: bump freebsd boot ghc to 9.10.3
This commit bumps freebsd boot ghc to 9.10.3 to align with other
platforms and prevent outdated boot libs in boot ghc to block the
freebsd job.
- - - - -
17e3a0b7 by Cheng Shao at 2026-04-24T14:37:21-04:00
compiler: improve Binary instance of Array
This patch improves the `Binary` instance of `Array`:
- We no longer allocate intermediate lists. When serializing an
`Array`, we iterate over the elements directly; when deserializing
it, we allocate the result `Array` and fill it in a loop.
- Now we only serialize the array bounds tuple; the length field is
not needed.
Closes #27109.
- - - - -
2d30f7d3 by sheaf at 2026-04-24T14:38:23-04:00
Vendor mini-QuickCheck for testsuite
This commit extracts the vendored QuickCheck implementation from the
foundation testsuite to make it more broadly available in the GHC
testsuite, and makes use of it in the simd006 test (which also used
a vendored QuickCheck implementation).
On the way, we update the linear congruential generator to avoid the
shortcoming of only generating 31 bit large numbers.
Fixes #25990 and #25969.
- - - - -
1350271b by sheaf at 2026-04-27T09:32:53-04:00
Ensure TcM plugins are only initialised once
This commit ensures we keep TcM plugins (typechecker plugins,
defaulting plugins and hole fit plugins) running all the way through
desugaring, instead of stopping them at the end of typechecking.
To do this, the "stop" actions of TcPlugin and DefaultingPlugin are
split into two: one for the "post-typecheck" action, and one for the
final shutdown action (after desugaring).
This allows the plugins to be invoked by the pattern match checker
(during desugaring) without having to be repeatedly re-initialised and
stopped, fixing #26839.
In the process, this commit modifies 'initTc' and 'initTcInteractive',
adding an extra argument that describes whether to start/stop the 'TcM'
plugins.
See Note [Stop TcM plugins after desugaring] for an overview.
- - - - -
42549222 by sheaf at 2026-04-27T09:33:50-04:00
Hadrian: add --keep-response-files
This commit adds a Hadrian flag that allows response files to be
retained. This is useful for debugging a failing Hadrian command line.
- - - - -
40564e8d by sheaf at 2026-04-27T09:34:46-04:00
hadrian/build-cabal.bat: fix build on Windows
Commit 8cb99552f6 introduced a warning for a missing package index.
However, the logic was faulty on Windows: the piping was broken, and
"remote-repo-cache:" was being interpreted as a (malformed) drive letter,
leading to the error:
The filename, directory name, or volume label syntax is incorrect.
This commit fixes that by using a temporary file instead of piping.
- - - - -
14bc71e4 by Sven Tennie at 2026-04-28T13:22:47-04:00
ghc: Distinguish between having an interpreter and having an internal one
Actually, these are related but different things:
- ghc can run an interpreter (either internal or external)
- ghc is compiled with an internal interpreter
Splitting the logic solves compiler warnings and expresses the intent
better.
- - - - -
df691563 by Vladislav Zavialov at 2026-04-28T13:23:29-04:00
Refactor HsWildCardTy to use HoleKind (#27111)
The payload of this patch is that the extension fields of HsWildCardTy
and HsHole now match:
type instance XWildCardTy Ghc{Ps,Rn} = HoleKind
type instance XHole Ghc{Ps,Rn} = HoleKind
This is progress towards unification of HsExpr and HsType.
Test case: T25121_status
In addition to that, exact-printing of infix holes is fixed.
Test case: PprInfixHole
- - - - -
f3485446 by fendor at 2026-04-28T13:24:12-04:00
Expose startupHpc as an rts symbol
- - - - -
28f07d70 by fendor at 2026-04-28T13:24:12-04:00
Make HPC work with bytecode interpreter
Add support to generate .tix files from bytecode objects and the
bytecode interpreter.
Conceptually, we insert HPC ticks into the bytecode similar to how we insert
breakpoints.
HPC and breakpoints do not share the same tick array but we use a separate
tick-array for hpc/breakpoint ticks during bytecode generation.
We teach the bytecode interpreter to handle hpc ticks.
The implementation is quite trivial, simply increment the counter in the
global hpc_ticks array for the respective module.
This hpc_ticks array is generated as part of the `CStub`, so we can rely
on it existing.
A tricky bit is "registering" a bytecode object for HPC instrumentation.
In the compiled case, this is achieved via CStub and initializer/finalizers
`.init` sections which are called when the executable is run.
After the initializers have been invoked, which is before `hs_init_ghc`,
we then call `startup_hpc` in `hs_init_ghc` iff any modules were "registered"
for hpc instrumentation via `hs_hpc_module`.
Since bytecode objects are loaded after starting up GHCi, this workflow
doesn't work for supporting `hpc` and the `hpc` run-time is never
started, even if a module is added for instrumentation.
We fix this issue by employing the same technique as is for `SptEntry`s:
* We introduce a new field to `CompiledByteCode`, called `ByteCodeHpcInfo`
which contains enough information to call `hs_hpc_module`, allowing us to
register the module for `hpc` instrumentation`.
* After registering the module, we unconditionally call `startupHpc`, to make
sure the .tix file is written.
Calling `startupHpc` multiple times is safe.
Calling `hs_hpc_module` multiple times for the same module is also safe.
If we didn't register the hpc module in this way, evaluating a bytecode object
instrumented with `-fhpc` without registering it in the `hpc` run-time will
simply not generate any `.tix` files for this bytecode object.
However, this shouldn't happen if everything is set up correctly.
Closes #27036
- - - - -
950879f0 by Vladislav Zavialov at 2026-04-28T13:24:55-04:00
Move NamespaceSpecifier from x-fields into the AST proper (#26678)
This refactoring moves NamespaceSpecifier out of extension fields and into the
AST proper, as it is part of the user-written source, and is not pass-specific.
Summary of changes:
* Move NamespaceSpecifier from GHC/Hs/Basic.hs to Language/Haskell/Syntax/ImpExp.hs
and parameterise it by the compiler pass, creating the necessary extension points
* Move NamespaceSpecifier out of XFixitySig into FixitySig
* Move NamespaceSpecifier out of XIEThingAll (IEThingAllExt) into IEThingAll
* Move NamespaceSpecifier out of XIEWholeNamespace (IEWholeNamespaceExt) into IEWholeNamespace
This is a pure refactoring with no change in behaviour.
- - - - -
9797052b by Simon Peyton Jones at 2026-04-28T13:25:37-04:00
Fix assertion check in checkResultTy
As #27210 shows, the assertion was a little bit too eager.
I refactored a bit by moving some code from GHC.Tc.Gen.App
to GHC.Tc.Utils.Unify; see the new function tcSubTypeApp,
which replaces tcSubTypeDS
- - - - -
9f85f034 by Duncan Coutts at 2026-04-30T04:52:42-04:00
Make cmm 'import "package" name;' syntax use consistent label types
There is a little-used syntactic form in cmm imports:
import "package" foo;
Which means to import foo from the given package (unit id, specified as
a string). This syntax is somewhat reminiscent of GHC's package import
extension.
This syntax form is not used in the rts cmm code, nor any of the boot
libraries. It may not be used at all. Unclear.
Change the kind of CLabel this syntax generates to be consistent with
the others. The other cmm imports use ForeignLabel with
ForeignLabelInExternalPackage. For some reason this form was using
CmmLabel. Change that to also be ForeignLabel but with
ForeignLabelInPackage. This specifies a specific package, rather
than an unnamed external package.
- - - - -
a811f68f by Duncan Coutts at 2026-04-30T04:52:42-04:00
Change default cmm import statements to be internal
Previously a cmm statement like:
import foo;
meant to expect the symbol from a different shared library than the
current one.
Now it means to expect the symbol from the same shared library as the
current one. We'll add explicit syntax to indicate that it's a foreign
import. Most existing uses are in fact intenal (rts to rts), so few
imports will need to be annotated foreign. Examples would include cmm
code in libraries (other than the rts) that need to access RTS APIs.
In practice, this makes no difference whatsoever at the moment on any
platform other than windows (where building Haskell libs as shared libs
does not fully work yet), since the 'labelDynamic' treats all such
labels as foreign, irrespective of the foreign label source.
- - - - -
17fe5d1d by Duncan Coutts at 2026-04-30T04:52:42-04:00
Add cmm import syntax 'import DATA foo;' as better name for CLOSURE
The existing syntax is:
import CLOSURE foo;
The new syntax is
import DATA foo;
This means to interpret the symbol foo as refering to data (i.e. a
global constant or variable) rather than to code (a function). The
historical syntax for this uses CLOSURE, which is rather misleading.
Presumably this was done to avoid introducing new reserved words.
Be less squemish about new reserved words and add DATA and use that.
Keep the existing CLOSURE syntax as an alias for compatibility.
- - - - -
3a530d68 by Duncan Coutts at 2026-04-30T04:52:42-04:00
Add cmm 'import extern name;' syntax
Since the default for cmm imports is now for symbols within the same
shared object, we need a way to indicate we want a symbol from an
external shared object:
import extern foo; -- for a function
import extern DATA foo; -- for data
This adds a new reserved word 'extern'.
We don't expect to have to use this much. Most cmm imports are
intra-DSO.
This makes no difference currently on ELF and MachO platforms, but does
make a difference to the linking conventions on PE (Windows).
In future it's plausible we could take make distinctions on ELF or
MachO, so it's worth trying to get it right. Windows can be the guinea
pig.
- - - - -
2b8e44c7 by Duncan Coutts at 2026-04-30T04:52:42-04:00
Add cmm syntax 'import "package" DATA foo;' for completeness
We already have:
import DATA foo; -- for data imports
import "package" foo; -- for imports from a given unitid
There's no reason not to have both at once:
import "package" DATA foo;
So add that.
- - - - -
ee05e5cc by Duncan Coutts at 2026-04-30T04:52:42-04:00
Improve the commentary for the cmm import grammar.
AFAIK, this is the only place where GHC-style Cmm syntax is documented.
- - - - -
b35946ad by Duncan Coutts at 2026-04-30T04:52:42-04:00
Add a changelog.d entry for the .cmm import syntax changes
- - - - -
d59b7c71 by Wolfgang Jeltsch at 2026-04-30T04:53:25-04:00
Move code that uses `GHC.Internal.Text.Read` into `base`
This contribution serves to remove all dependencies on
`GHC.Internal.Text.Read` from within `ghc-internal`, so that the
implementation of `Text.Read` and ultimately more reading-related code
can be moved to `base` as well.
The following things are moved from `ghc-internal` to `base`:
* I/O-related `Read` instances
* Most of the `Numeric` implementation
* The instance `Read ByteOrder`
* The `parseVersion` operation
* The `readConstr` operation
Metric Increase:
LinkableUsage01
T9198
T12425
T13035
T13820
T18140
- - - - -
5bd6a964 by Rodrigo Mesquita at 2026-04-30T04:54:08-04:00
New rts Message to {set,unset} TSO flags
This commit introduces stg_MSG_SET_TSO_FLAG_info and
stg_MSG_UNSET_TSO_FLAG_info, which allows setting flags of a TSO other
than yourself.
This is especially useful/necessary to set breakpoints and toggle
breakpoints of different threads, which is needed to safely implement
features like pausing, toggling step-out, toggling step-in per thread,
etc.
Fixes #27131
-------------------------
Metric Decrease:
T3294
-------------------------
- - - - -
ce97fd3e by Rodrigo Mesquita at 2026-04-30T04:54:08-04:00
test: Add test setting another TSO's flags
Introduces a test that runs on two capabilities. The main thread running
on Capability 0 sets the flags on a TSO running on Capability 1.
The TSO from Capability 1 itself checks whether its flags were set and
reports that back.
This validates that the RTS messages for setting TSO flags work, even if
it doesn't test a harsher scenario with race conditions to exercise why
the message passing is necessary for safely setting another TSO's flags.
Part of #27131
- - - - -
a4ff6315 by David Eichmann at 2026-04-30T04:54:51-04:00
Hadrian: withResponseFile outputs response file when verbodity is Verbose
At the Verbose verbosity, shake will display full commandlines. With the
use of response files, the full command is hidden. That makes it hard to run
the command manually. This commit outputs the contents of the response
file so that that full command can be recreated and also hints at the
use of the --keep-response-files hadrian flag.
- - - - -
cd732ee3 by Duncan Coutts at 2026-04-30T04:54:51-04:00
Use response files for hadrian linking with ghc (support long command lines)
In future support for windows dynamic linking, we expect long command
lines for linking dll files with ghc. Experiments with dynamic linking the
ghc-internal library yielded a link command well over 32kb. We did not
encounter this before for static libs, since we already use ar's @file
feature (if available, which it is for the llvm toolchain).
Co-authored-by: David Eichmann <davide(a)well-typed.com>
- - - - -
3d41368f by Andreas Klebinger at 2026-04-30T04:55:32-04:00
Split GHC.Driver.Main.hs up into multiple components.
This commit splits GHC.Driver.Main into four components:
* GHC.Driver.Main.Compile
* GHC.Driver.Main.Hsc
* GHC.Driver.Main.Interactive
* GHC.Driver.Main.Passes
We might improve that separation further in the future but this should
hopefully make it easier to reason about and work with this part of the
code.
- - - - -
2128ba85 by Cheng Shao at 2026-04-30T04:56:14-04:00
compiler: avoid unique OccNames for internal Names in bytecode objects
This patch improves bytecode object serialization logic by avoiding
the construction of unique `OccName`s when serializing/deserializing
internal `Name`s. Closes #27213.
-------------------------
Metric Decrease:
LinkableUsage01
-------------------------
- - - - -
e16854c3 by Vladislav Zavialov at 2026-04-30T04:56:57-04:00
Replace GHC 9.16 references with GHC 10.0
- - - - -
39141343 by Alice Rixte at 2026-05-01T14:09:32+02:00
Add Bounded instances for Double, Float, CDouble and CFloat
- - - - -
5c4c3bf4 by Sylvain Henry at 2026-05-02T03:39:28-04:00
testsuite: fix flaky foundation Divisible / mulIntMayOflo# tests (#27222)
Since the LCG was widened to 64 bits and the seed randomised per CI run
(commit 2d30f7d3400 "Vendor mini-QuickCheck for testsuite"), two latent
bugs in the foundation test surface stochastically:
* The Divisible property `(x `div` y) * y + (x `mod` y) == x` raises
ArithException(Overflow) when (a, b) = (minBound, -1) for fixed-width
signed Integral types. Split testNumber/testDivisible into Bounded and
unbounded variants and skip just that one pair, gated by
`(minBound :: a) < 0` so unsigned types lose no coverage.
* The `mulIntMayOflo#` test compared raw Int# bit-for-bit, but the primop
is only specified to return 0/non-zero -- the exact non-zero indicator
legitimately differs between backends and inlining choices. Add a
dedicated `testPrimopMayOflo` helper that only compares zero / non-zero.
Also fix the long-standing typo "Dividible" -> "Divisible" in identifiers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply(a)anthropic.com>
- - - - -
e242ce4f by Sylvain Henry at 2026-05-02T03:39:28-04:00
testsuite: catch and display exceptions in MiniQuickCheck
Exceptions raised while evaluating a property are now caught and reported
as a normal failure (with arguments and seed), instead of aborting the
test.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply(a)anthropic.com>
- - - - -
3b75cccd by fendor at 2026-05-02T03:40:14-04:00
Fix name of Note [Structure of dep_boot_mods]
- - - - -
38d79ec9 by Brandon Chinn at 2026-05-04T21:01:59-07:00
[refactor] Reorganize processChars functions
- - - - -
4b89d81b by Brandon Chinn at 2026-05-04T21:01:59-07:00
[refactor] Always use processCharsSingle to get StringLexError
- - - - -
47c60abe by Brandon Chinn at 2026-05-04T21:01:59-07:00
[refactor] Add pprHsStringMulti, unify string ppr functions
- - - - -
63d33dd8 by Brandon Chinn at 2026-05-04T21:01:59-07:00
[refactor] Break out GHC.Data.StringMeta
- - - - -
0a52e8e8 by Brandon Chinn at 2026-05-05T12:51:16-07:00
Implement interpolated strings
- - - - -
426 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/merge_request_templates/Default.md
- + changelog.d/T15973
- + changelog.d/T19174.md
- + changelog.d/T27121.md
- + changelog.d/T27124.md
- + changelog.d/T27131
- + changelog.d/binary-array-no-list
- + changelog.d/bytecode-interpreter-hpc-support
- + changelog.d/cmm-import-syntax-changes
- + changelog.d/fix-finalizers-27072
- + changelog.d/ghc-api-holes-ast-27111
- + changelog.d/ghc-api-namespace-specifier-26678
- + changelog.d/ghc-pkg-long-path-support
- + changelog.d/hadrian-response-files.md
- + changelog.d/hadrian-warn-missing-package-index-16484
- + changelog.d/llvm-22
- + changelog.d/simd_constant_folding
- + changelog.d/skip-test
- + changelog.d/tcplugin_init.md
- + changelog.d/tcplugins-pmc.md
- + changelog.d/typecheckModule-API.md
- + changelog.d/withTcPlugins.md
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Binary.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/ByteCode/Types.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/Core/Lint.hs
- + compiler/GHC/Core/Lint/SubstTypeLets.hs
- compiler/GHC/Core/Opt/FloatOut.hs
- compiler/GHC/Core/Opt/OccurAnal.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Data/FastString.hs
- compiler/GHC/Data/Pair.hs
- + compiler/GHC/Data/StringMeta.hs
- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Config/Core/Lint.hs
- compiler/GHC/Driver/Env/Types.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main.hs
- + compiler/GHC/Driver/Main/Compile.hs
- compiler/GHC/Driver/Main.hs-boot → compiler/GHC/Driver/Main/Compile.hs-boot
- + compiler/GHC/Driver/Main/Hsc.hs
- + compiler/GHC/Driver/Main/Interactive.hs
- + compiler/GHC/Driver/Main/Passes.hs
- + compiler/GHC/Driver/Main/Passes.hs-boot
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Pipeline/Monad.hs
- compiler/GHC/Driver/Pipeline/Phases.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Expr.hs-boot
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Coverage.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Pmc/Solver/Types.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/HsToCore/Types.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/Linker/Executable.hs
- compiler/GHC/Linker/Loader.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/Lexer/String.x
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- + compiler/GHC/Rename/String.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/Runtime/Interpreter.hs
- compiler/GHC/Runtime/Loader.hs
- compiler/GHC/Stg/Debug.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Hole.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Rewrite.hs
- compiler/GHC/Tc/Solver/Solve.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Tc/Zonk/Type.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Error.hs-boot
- compiler/GHC/Types/ForeignStubs.hs
- compiler/GHC/Types/HpcInfo.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/Tickish.hs
- compiler/GHC/Types/Unique/DSet.hs
- compiler/GHC/Unit/Module/Deps.hs
- compiler/GHC/Unit/Module/ModGuts.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Misc.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/GHC/Utils/Ppr/Colour.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Expr.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/ghc.cabal.in
- configure.ac
- docs/users_guide/debug-info.rst
- docs/users_guide/extending_ghc.rst
- docs/users_guide/exts/explicit_namespaces.rst
- docs/users_guide/exts/linear_types.rst
- docs/users_guide/exts/modifiers.rst
- docs/users_guide/exts/qualified_strings.rst
- docs/users_guide/exts/required_type_arguments.rst
- docs/users_guide/using-warnings.rst
- docs/users_guide/using.rst
- ghc/GHC/Driver/Session/Mode.hs
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- ghc/Main.hs
- ghc/ghc-bin.cabal.in
- hadrian/build-cabal
- hadrian/build-cabal.bat
- hadrian/doc/flavours.md
- hadrian/doc/make.md
- hadrian/doc/testsuite.md
- hadrian/src/Builder.hs
- hadrian/src/CommandLine.hs
- hadrian/src/Hadrian/Builder.hs
- hadrian/src/Hadrian/Builder/Ar.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/changelog.md
- libraries/base/src/Control/Concurrent.hs
- libraries/base/src/Data/Data.hs
- libraries/base/src/Data/Version.hs
- libraries/base/src/GHC/ByteOrder.hs
- libraries/base/src/GHC/IO/Handle.hs
- libraries/base/src/Numeric.hs
- libraries/base/src/Prelude.hs
- libraries/base/src/System/IO.hs
- libraries/base/src/Text/Printf.hs
- libraries/base/tests/perf/all.T
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-boot/GHC/Unit/Database.hs
- libraries/ghc-boot/ghc-boot.cabal.in
- libraries/ghc-experimental/ghc-experimental.cabal.in
- + libraries/ghc-experimental/src/Data/String/Interpolate/Experimental.hs
- libraries/ghc-heap/tests/tso_and_stack_closures.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/include/CTypes.h
- libraries/ghc-internal/src/GHC/Internal/Data/Data.hs
- + libraries/ghc-internal/src/GHC/Internal/Data/String/Interpolate.hs
- libraries/ghc-internal/src/GHC/Internal/Data/Version.hs
- libraries/ghc-internal/src/GHC/Internal/Float.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Device.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Types.hs
- libraries/ghc-internal/src/GHC/Internal/IO/IOMode.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/src/GHC/Internal/Numeric.hs
- libraries/ghc-internal/src/GHC/Internal/Read.hs
- libraries/ghc-internal/src/GHC/Internal/System/IO.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lift.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- + libraries/ghci/GHCi/Coverage.hs
- libraries/ghci/GHCi/Message.hs
- libraries/ghci/GHCi/Run.hs
- libraries/ghci/GHCi/TH/Binary.hs
- libraries/ghci/ghci.cabal.in
- libraries/template-haskell/Language/Haskell/TH/Lib.hs
- rts/Disassembler.c
- rts/Hpc.c
- rts/Interpreter.c
- rts/Linker.c
- rts/LinkerInternals.h
- rts/Messages.c
- rts/RtsSymbols.c
- rts/StgMiscClosures.cmm
- rts/Threads.c
- rts/Threads.h
- rts/include/rts/Bytecodes.h
- rts/include/rts/storage/Closures.h
- rts/include/stg/MiscClosures.h
- rts/linker/Elf.c
- testsuite/driver/runtests.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- + testsuite/tests/MiniQuickCheck.hs
- testsuite/tests/cabal/Makefile
- testsuite/tests/cabal/all.T
- + testsuite/tests/cabal/ghcpkg10.stdout
- + testsuite/tests/codeGen/should_run/T27072d.hs
- + testsuite/tests/codeGen/should_run/T27072d.stdout
- + testsuite/tests/codeGen/should_run/T27072d_c.c
- + testsuite/tests/codeGen/should_run/T27072d_check.c
- + testsuite/tests/codeGen/should_run/T27072w.hs
- + testsuite/tests/codeGen/should_run/T27072w.stdout
- + testsuite/tests/codeGen/should_run/T27072w_c.c
- testsuite/tests/codeGen/should_run/all.T
- testsuite/tests/corelint/LintEtaExpand.stderr
- testsuite/tests/corelint/T21115b.stderr
- + testsuite/tests/driver/T10531/A.hs
- + testsuite/tests/driver/T10531/B.hs
- + testsuite/tests/driver/T10531/C.hs
- + testsuite/tests/driver/T10531/Makefile
- + testsuite/tests/driver/T10531/all.T
- testsuite/tests/driver/T4437.hs
- testsuite/tests/ghc-api/T25121_status.stdout
- testsuite/tests/ghc-api/T26910.hs
- testsuite/tests/ghc-api/T6145.hs
- + testsuite/tests/ghci/T9074/Makefile
- + testsuite/tests/ghci/T9074/T9074.hs
- + testsuite/tests/ghci/T9074/T9074.stdout
- + testsuite/tests/ghci/T9074/T9074a.c
- + testsuite/tests/ghci/T9074/T9074b.c
- + testsuite/tests/ghci/T9074/all.T
- testsuite/tests/ghci/should_run/tc-plugin-ghci/TcPluginGHCi.hs
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/hpc/Makefile
- testsuite/tests/hpc/T17073.stdout → testsuite/tests/hpc/T17073a.stdout
- + testsuite/tests/hpc/T17073b.stdout
- testsuite/tests/hpc/T20568.stdout → testsuite/tests/hpc/T20568a.stdout
- + testsuite/tests/hpc/T20568b.stdout
- testsuite/tests/hpc/all.T
- testsuite/tests/hpc/fork/Makefile
- testsuite/tests/hpc/function/Makefile
- testsuite/tests/hpc/function/test.T
- + testsuite/tests/hpc/function/tough1.stderr
- + testsuite/tests/hpc/function/tough1.stdout
- testsuite/tests/hpc/function2/test.T
- + testsuite/tests/hpc/function2/tough3.script
- + testsuite/tests/hpc/ghc_ghci/BytecodeMain.hs
- testsuite/tests/hpc/ghc_ghci/Makefile
- + testsuite/tests/hpc/ghc_ghci/hpc_ghc_ghci_bytecode.stdout
- + testsuite/tests/hpc/ghc_ghci/hpc_ghci01.stdout
- + testsuite/tests/hpc/ghc_ghci/hpc_ghci02.stdout
- testsuite/tests/hpc/ghc_ghci/test.T
- testsuite/tests/hpc/simple/Makefile
- + testsuite/tests/hpc/simple/hpc002.hs
- + testsuite/tests/hpc/simple/hpc002.stdout
- + testsuite/tests/hpc/simple/hpc003.hs
- + testsuite/tests/hpc/simple/hpc003.script
- + testsuite/tests/hpc/simple/hpc003.stdout
- testsuite/tests/hpc/simple/test.T
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/linters/notes.stdout
- testsuite/tests/numeric/should_run/all.T
- testsuite/tests/numeric/should_run/foundation.hs
- + testsuite/tests/overloadedstrings/should_fail/T25926.hs
- + testsuite/tests/overloadedstrings/should_fail/T25926.stderr
- + testsuite/tests/overloadedstrings/should_fail/T27124.hs
- + testsuite/tests/overloadedstrings/should_fail/T27124.stderr
- + testsuite/tests/overloadedstrings/should_fail/all.T
- + testsuite/tests/overloadedstrings/should_run/T27124a.hs
- testsuite/tests/overloadedstrings/should_run/all.T
- testsuite/tests/parser/should_compile/T20846.stderr
- + testsuite/tests/parser/should_fail/MultilineStringsEscapeOverflow.hs
- + testsuite/tests/parser/should_fail/MultilineStringsEscapeOverflow.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationEscapeOverflow.hs
- + testsuite/tests/parser/should_fail/StringInterpolationEscapeOverflow.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationExtraOpen.hs
- + testsuite/tests/parser/should_fail/StringInterpolationExtraOpen.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationInPat.hs
- + testsuite/tests/parser/should_fail/StringInterpolationInPat.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationInType.hs
- + testsuite/tests/parser/should_fail/StringInterpolationInType.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationIncompleteExpr.hs
- + testsuite/tests/parser/should_fail/StringInterpolationIncompleteExpr.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationInvalidExpr.hs
- + testsuite/tests/parser/should_fail/StringInterpolationInvalidExpr.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationLineComment.hs
- + testsuite/tests/parser/should_fail/StringInterpolationLineComment.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationNoDelimClose.hs
- + testsuite/tests/parser/should_fail/StringInterpolationNoDelimClose.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationNoExpr.hs
- + testsuite/tests/parser/should_fail/StringInterpolationNoExpr.stderr
- + testsuite/tests/parser/should_fail/StringInterpolationNoExprClose.hs
- + testsuite/tests/parser/should_fail/StringInterpolationNoExprClose.stderr
- testsuite/tests/parser/should_fail/all.T
- + testsuite/tests/parser/should_run/StringInterpolation.hs
- + testsuite/tests/parser/should_run/StringInterpolation.stdout
- + testsuite/tests/parser/should_run/StringInterpolationOverloaded.hs
- + testsuite/tests/parser/should_run/StringInterpolationOverloaded.stdout
- testsuite/tests/parser/should_run/all.T
- testsuite/tests/plugins/defaulting-plugin/DefaultInterference.hs
- testsuite/tests/plugins/defaulting-plugin/DefaultInvalid.hs
- testsuite/tests/plugins/defaulting-plugin/DefaultLifted.hs
- testsuite/tests/plugins/defaulting-plugin/DefaultMultiParam.hs
- testsuite/tests/plugins/echo-plugin/Echo.hs
- testsuite/tests/plugins/plugins09.stdout
- testsuite/tests/plugins/plugins10.stdout
- testsuite/tests/plugins/plugins11.stdout
- testsuite/tests/plugins/static-plugins.stdout
- testsuite/tests/printer/Makefile
- + testsuite/tests/printer/PprInfixHole.hs
- testsuite/tests/printer/all.T
- + testsuite/tests/profiling/should_compile/T27121.hs
- + testsuite/tests/profiling/should_compile/T27121_aux.hs
- testsuite/tests/profiling/should_compile/all.T
- + testsuite/tests/qualified-strings/should_run/Example/SQL.hs
- testsuite/tests/qualified-strings/should_run/all.T
- + testsuite/tests/qualified-strings/should_run/qstrings_interpolation.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_interpolation.stdout
- testsuite/tests/quasiquotation/T7918.hs
- + testsuite/tests/rts/T27131.hs
- + testsuite/tests/rts/T27131.stdout
- + testsuite/tests/rts/T27131_c.c
- testsuite/tests/rts/all.T
- + testsuite/tests/rts/linker/T27072/Lib.c
- + testsuite/tests/rts/linker/T27072/Makefile
- + testsuite/tests/rts/linker/T27072/T27072.stdout
- + testsuite/tests/rts/linker/T27072/all.T
- + testsuite/tests/rts/linker/T27072/main.c
- + testsuite/tests/simd/should_run/Makefile
- + testsuite/tests/simd/should_run/T25030.hs
- + testsuite/tests/simd/should_run/T25030.stdout
- testsuite/tests/simd/should_run/all.T
- testsuite/tests/simd/should_run/simd006.hs
- + testsuite/tests/simplCore/should_compile/T26941.hs
- + testsuite/tests/simplCore/should_compile/T26941_aux.hs
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/tcplugins/Common.hs
- testsuite/tests/tcplugins/RewritePerfPlugin.hs
- testsuite/tests/tcplugins/T11462_Plugin.hs
- testsuite/tests/tcplugins/T11525_Plugin.hs
- testsuite/tests/tcplugins/T26395_Plugin.hs
- + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.hs
- + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.script
- + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.stderr
- + testsuite/tests/tcplugins/TcPlugin_InitStop_Ghci.stdout
- + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode.hs
- + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode.hs-boot
- + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode.stderr
- + testsuite/tests/tcplugins/TcPlugin_InitStop_NoCode_aux.hs
- + testsuite/tests/tcplugins/TcPlugin_InitStop_Warn.hs
- + testsuite/tests/tcplugins/TcPlugin_InitStop_Warn.stderr
- testsuite/tests/tcplugins/all.T
- + testsuite/tests/tcplugins/tc-plugin-initstop/Makefile
- + testsuite/tests/tcplugins/tc-plugin-initstop/Setup.hs
- + testsuite/tests/tcplugins/tc-plugin-initstop/TcPlugin_InitStop_Plugin.hs
- + testsuite/tests/tcplugins/tc-plugin-initstop/tc-plugin-initstop.cabal
- testsuite/tests/th/all.T
- testsuite/tests/typecheck/should_compile/T9497a.stderr
- testsuite/tests/typecheck/should_compile/holes.stderr
- testsuite/tests/typecheck/should_compile/holes3.stderr
- testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
- + testsuite/tests/typecheck/should_fail/T27210.hs
- + testsuite/tests/typecheck/should_fail/T27210.stderr
- testsuite/tests/typecheck/should_fail/T9497d.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T9497a-run.stderr
- testsuite/tests/typecheck/should_run/T9497b-run.stderr
- testsuite/tests/typecheck/should_run/T9497c-run.stderr
- testsuite/tests/wasm/should_run/control-flow/LoadCmmGroup.hs
- utils/check-exact/ExactPrint.hs
- utils/ghc-pkg/Main.hs
- utils/ghc-pkg/ghc-pkg.cabal.in
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/AttachInstances.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
- utils/haddock/html-test/ref/Bug1004.html
- utils/haddock/html-test/ref/Bug973.html
- utils/haddock/html-test/ref/ConstructorPatternExport.html
- utils/haddock/html-test/ref/DefaultSignatures.html
- utils/haddock/html-test/ref/Hash.html
- utils/haddock/html-test/ref/PatternSyns.html
- utils/haddock/html-test/ref/PatternSyns2.html
- utils/haddock/html-test/ref/QuasiExpr.html
- utils/haddock/html-test/ref/Test.html
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b408332d8aef8763e7a8d5611d6896…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b408332d8aef8763e7a8d5611d6896…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sol/dont-use-global-variables] Don't use global variables to address concurrency bugs! (fixes #27234)
by Simon Hengel (@sol) 05 May '26
by Simon Hengel (@sol) 05 May '26
05 May '26
Simon Hengel pushed to branch wip/sol/dont-use-global-variables at Glasgow Haskell Compiler / GHC
Commits:
a3c8f7c8 by Simon Hengel at 2026-05-06T02:20:24+07:00
Don't use global variables to address concurrency bugs! (fixes #27234)
This was originally introduce with
88f38b03025386f0f1e8f5861eed67d80495168a to address #17922.
In this specific case a better fix would have been to synchronize on
stderr:
withHandle_ "stderrSupportsAnsiColors" stderr $ \ _ -> do
...
But apparently the dependency on `terminfo` was removed in
32ab07bf3d6ce45e8ea5b55e8095174a6b42a7f0, preventing #17922 in the first
place.
- - - - -
3 changed files:
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/SysTools/Terminal.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
Changes:
=====================================
compiler/GHC/Driver/DynFlags.hs
=====================================
@@ -545,6 +545,7 @@ initDynFlags dflags = do
`catchIOError` \_ -> return False
ghcNoUnicodeEnv <- lookupEnv "GHC_NO_UNICODE"
let useUnicode' = isNothing ghcNoUnicodeEnv && canUseUnicode
+ canUseColor <- stderrSupportsAnsiColors
maybeGhcColorsEnv <- lookupEnv "GHC_COLORS"
maybeGhcColoursEnv <- lookupEnv "GHC_COLOURS"
let adjustCols (Just env) = Col.parseScheme env
@@ -556,9 +557,9 @@ initDynFlags dflags = do
return dflags{
useUnicode = useUnicode',
useColor = useColor',
- canUseColor = stderrSupportsAnsiColors,
+ canUseColor = canUseColor,
-- if the terminal supports color, we assume it supports links as well
- canUseErrorLinks = stderrSupportsAnsiColors,
+ canUseErrorLinks = canUseColor,
colScheme = colScheme',
tmpDir = TempDir tmp_dir
}
=====================================
compiler/GHC/SysTools/Terminal.hs
=====================================
@@ -14,17 +14,9 @@ import qualified Graphics.Win32 as Win32
import qualified System.Win32 as Win32
#endif
-import System.IO.Unsafe
-
--- | Does the controlling terminal support ANSI color sequences?
--- This memoized to avoid thread-safety issues in ncurses (see #17922).
-stderrSupportsAnsiColors :: Bool
-stderrSupportsAnsiColors = unsafePerformIO stderrSupportsAnsiColors'
-{-# NOINLINE stderrSupportsAnsiColors #-}
-
-- | Check if ANSI escape sequences can be used to control color in stderr.
-stderrSupportsAnsiColors' :: IO Bool
-stderrSupportsAnsiColors' = do
+stderrSupportsAnsiColors :: IO Bool
+stderrSupportsAnsiColors = do
#if !defined(mingw32_HOST_OS)
-- Equivalent of https://hackage.haskell.org/package/ansi-terminal/docs/System-Console-ANSI.…
isTerminal <- hIsTerminalDevice stderr
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
=====================================
@@ -143,8 +143,8 @@ original handle is always replaced.
{-# INLINE withHandle #-}
withHandle :: String -> Handle -> (Handle__ -> IO (Handle__,a)) -> IO a
-withHandle fun h@(FileHandle _ m) act = withHandle' fun h m act
-withHandle fun h@(DuplexHandle _ m _) act = withHandle' fun h m act
+withHandle fun h@(FileHandle _ m) = withHandle' fun h m
+withHandle fun h@(DuplexHandle _ m _) = withHandle' fun h m
withHandle' :: String -> Handle -> MVar Handle__
-> (Handle__ -> IO (Handle__,a)) -> IO a
@@ -157,8 +157,8 @@ withHandle' fun h m act =
{-# INLINE withHandle_ #-}
withHandle_ :: String -> Handle -> (Handle__ -> IO a) -> IO a
-withHandle_ fun h@(FileHandle _ m) act = withHandle_' fun h m act
-withHandle_ fun h@(DuplexHandle _ m _) act = withHandle_' fun h m act
+withHandle_ fun h@(FileHandle _ m) = withHandle_' fun h m
+withHandle_ fun h@(DuplexHandle _ m _) = withHandle_' fun h m
withHandle_' :: String -> Handle -> MVar Handle__ -> (Handle__ -> IO a) -> IO a
withHandle_' fun h m act = withHandle' fun h m $ \h_ -> do
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a3c8f7c88ecd3814ede806604eae0e4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a3c8f7c88ecd3814ede806604eae0e4…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 12 commits: Use __attribute__((dllimport)) for external RTS symbol declarations
by Marge Bot (@marge-bot) 05 May '26
by Marge Bot (@marge-bot) 05 May '26
05 May '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
9a9ae4df by Duncan Coutts at 2026-05-05T14:44:37-04:00
Use __attribute__((dllimport)) for external RTS symbol declarations
This is needed to be hygenic about DLL symbol imports and exports.
The attribute is ignored on platforms other than Windows.
Use of the attribute however means that external data symbols do not
have a compile-time constant address (they are loaded using an
indirection). This means we have to adjust the rtsSyms initial linker
table so that it is a local constant in a function, rather than a global
constant. We now define it within a function that pre-populates the
symbol table with the RTS symbols.
- - - - -
2ad3e01e by Duncan Coutts at 2026-05-05T14:44:37-04:00
Fix the rts linker declarations for a few data symbols
and ensure that the (windows only) rts_IOManagerIsWin32Native data
symbol is marked as externally visible.
- - - - -
8ff4fdb5 by David Eichmann at 2026-05-05T14:44:37-04:00
Hadrian: Disable runtime pseudo relocations for RTS on windows hosts
- - - - -
96974723 by Teo Camarasu at 2026-05-05T14:45:20-04:00
ghci/TH: refactor to use IORef QState
This is a pure refactor and shouldn't modify semantics at all
- - - - -
eff6bfaf by Teo Camarasu at 2026-05-05T14:45:20-04:00
iserv: recover/getQ/putQ should behave same as internal interpreter
The internal and external interpreter should behave the same when
handling `recover`, the exeception recovery method of Q.
In practice, they diverge. In case of failure, the internal interpreter
only restores error message state to before the computation, wheras the
external interperter restores error message state *and* the state of putQ/getQ.
As far as I can tell this is a simple mistake in the implementation.
Note [TH recover with -fexternal-interpreter] describes the correct
behaviour but the implementation doesn't mirror this.
This change restores the correct behaviour by keeping the effects of
putQ in the erroring computation.
This is a breaking change since it modifies the behaviour of programs
that rely on recover ignoring putQ from failling computations when used
with the external interpreter. Although I highly doubt anyone relies on
this behaviour.
This divergence was first introduced in d00c308633fe7d216d31a1087e00e63532d87d6d.
As far as I can tell this was unintentional and tha commit was trying to solve a different bug.
Resolves #27022
- - - - -
c05637f1 by Wen Kokke at 2026-05-05T15:17:15-04:00
rts: Add dynamic trace flags API
This commit adds an API to the RTS (exposed via Rts.h) that allows users to dynamically change the trace flags.
Prior to this commit, users were able to stop and start the profiling and heap profiling timers (via startProfTimer/stopProfTimer and startHeapProfTimer/stopHeapProfTimer).
This extends that functionality to also cover the core event types.
The getTraceFlag/setTraceFlag functions read and write the values of the trace flag cache, which is allocated by Trace.c, rather than modifying the members of RtsFlags.TraceFlags.
This is done under the assumption that the members of RtsFlags should not be modified after RTS initialisation.
Consequently, if the user modifies the trace flags using setTraceFlag, the object returned by getTraceFlags (from base) will not reflect these changes.
The trace flags are not protected by locks of any sort.
Hence, these functions are not thread-safe.
However, the trace flags are not modified by the RTS after initialisation, only read, so the race conditions introduced by one user modifying them are most likely benign.
This PR also puts the trace flag cache in a single global struct, as opposed to a collection of global variables, and changes the types of the individual flags from uint8_t to bool, as these have the same size on both Clang and GCC and are a better semantic match.
Prior to the change to uint8_t, they had type int, see 42c47cd6.
Even with its deprecation in C23, I don't think there should be any issue depending on stdbool.h.
The TRACE_X macros are redefined to access the global struct, with values cast to const bool to ensure they are read-only.
- - - - -
f45af756 by Wen Kokke at 2026-05-05T15:17:15-04:00
rts: Ensure TRACE_X values are used in place of RtsFlags.TraceFlags.X
- - - - -
5a48b387 by Wen Kokke at 2026-05-05T15:17:15-04:00
rts: Fix nonmoving-GC tracing
The current nonmoving-GC tracing functions were written in a different
style from the other tracing functions. They were directly implemented
as, e.g., a traceConcMarkEnd function that called postConcMarkEnd.
The other tracing functions are implemented as, e.g., traceThreadLabel_,
a function that posts the thread label event, and traceThreadLabel, a
macro that checks whether TRACE_scheduler is set. This commit fixes that
implementation, and ensures that the nonmoving-GC tracing functions only
emit events if nonmoving-GC tracing is enabled.
- - - - -
e9d7c55f by Wen Kokke at 2026-05-05T15:17:15-04:00
rts: Add SymI_HasProto for get/setTraceFlag
- - - - -
a8e8a1c7 by Wen Kokke at 2026-05-05T15:17:15-04:00
rts: Add SymI_HasProto for start/endEventLogging
- - - - -
fabfdfec by Wen Kokke at 2026-05-05T15:17:15-04:00
rts: Add changelog entry
- - - - -
2a3b220b by Teo Camarasu at 2026-05-05T15:17:16-04:00
interface-stability/base: don't distinguish ws-32
The interface of base is identical when the Word size is 32bits.
Therefore, there is no need to have another file for this case.
So, we delete it.
Step towards: #26752
- - - - -
18 changed files:
- + changelog.d/T27022
- + changelog.d/dynamic-trace-flags
- hadrian/src/Settings/Packages.hs
- libraries/ghci/GHCi/TH.hs
- rts/IOManager.h
- rts/Linker.c
- rts/LinkerInternals.h
- rts/RtsSymbols.c
- rts/RtsSymbols.h
- rts/Trace.c
- rts/Trace.h
- rts/include/rts/EventLogWriter.h
- rts/linker/Elf.c
- rts/sm/NonMoving.c
- − testsuite/tests/interface-stability/base-exports.stdout-ws-32
- + testsuite/tests/th/T27022.hs
- + testsuite/tests/th/T27022.stdout
- testsuite/tests/th/all.T
Changes:
=====================================
changelog.d/T27022
=====================================
@@ -0,0 +1,11 @@
+section: compiler
+synopsis: Fix a divergence in the interaction between ``recover`` and ``putQ`` between the internal and external interpreter
+description: The ``recover`` method in TemplateHaskell now behaves the same
+ with the internal and external interpreter.
+ In the past, when an error was encountered in a computation in a ``recover`` block,
+ the external interpreter would discard any state changes from ``putQ``,
+ whereas the internal interpreter would not.
+ This was a long-standing error in the implementation of the external interpreter.
+ Both now keep state changes from ``putQ`` in ``recover`` blocks.
+mrs: !15994
+issues: #27022
=====================================
changelog.d/dynamic-trace-flags
=====================================
@@ -0,0 +1,10 @@
+section: compiler
+synopsis: Support dynamic trace flags in RTS
+issues: #27186
+mrs: !15936
+
+description: {
+ The RTS API now exposes the `RUNTIME_TRACE_FLAG` type and
+ the `getTraceFlags` and `setTraceFlags` functions that can be used to
+ change the trace flags at runtime.
+}
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -322,6 +322,7 @@ rtsPackageArgs = package rts ? do
, Profiling `wayUnit` way ? arg "-DPROFILING"
, Threaded `wayUnit` way ? arg "-DTHREADED_RTS"
, notM targetSupportsSMP ? arg "-optc-DNOSMP"
+ , isWinHost ? arg "-optl-Wl,--disable-runtime-pseudo-reloc"
-- See Note [AutoApply.cmm for vectors] in genapply/Main.hs
--
=====================================
libraries/ghci/GHCi/TH.hs
=====================================
@@ -119,7 +119,7 @@ initQState :: Pipe -> QState
initQState p = QState M.empty Nothing p
-- | The monad in which we run TH computations on the server
-newtype GHCiQ a = GHCiQ { runGHCiQ :: QState -> IO (a, QState) }
+newtype GHCiQ a = GHCiQ { runGHCiQ :: IORef QState -> IO a }
-- | The exception thrown by "fail" in the GHCiQ monad
data GHCiQException = GHCiQException QState String
@@ -128,52 +128,54 @@ data GHCiQException = GHCiQException QState String
instance Exception GHCiQException
instance Functor GHCiQ where
- fmap f (GHCiQ s) = GHCiQ $ fmap (\(x,s') -> (f x,s')) . s
+ fmap f (GHCiQ m) = GHCiQ $ fmap f . m
instance Applicative GHCiQ where
f <*> a = GHCiQ $ \s ->
- do (f',s') <- runGHCiQ f s
- (a',s'') <- runGHCiQ a s'
- return (f' a', s'')
- pure x = GHCiQ (\s -> return (x,s))
+ do f' <- runGHCiQ f s
+ a' <- runGHCiQ a s
+ return $ f' a'
+ pure x = GHCiQ $ \_ -> return x
instance Monad GHCiQ where
m >>= f = GHCiQ $ \s ->
- do (m', s') <- runGHCiQ m s
- (a, s'') <- runGHCiQ (f m') s'
- return (a, s'')
+ do m' <- runGHCiQ m s
+ a <- runGHCiQ (f m') s
+ return a
instance MonadFail GHCiQ where
- fail err = GHCiQ $ \s -> throwIO (GHCiQException s err)
+ fail err = GHCiQ $ \sRef -> readIORef sRef >>= \s -> throwIO (GHCiQException s err)
getState :: GHCiQ QState
-getState = GHCiQ $ \s -> return (s,s)
+getState = GHCiQ $ \sRef -> readIORef sRef
noLoc :: TH.Loc
noLoc = TH.Loc "<no file>" "<no package>" "<no module>" (0,0) (0,0)
-- | Send a 'THMessage' to GHC and return the result.
ghcCmd :: Binary a => THMessage (THResult a) -> GHCiQ a
-ghcCmd m = GHCiQ $ \s -> do
+ghcCmd m = GHCiQ $ \sRef -> do
+ s <- readIORef sRef
r <- remoteTHCall (qsPipe s) m
case r of
THException str -> throwIO (GHCiQException s str)
- THComplete res -> return (res, s)
+ THComplete res -> return res
instance MonadIO GHCiQ where
- liftIO m = GHCiQ $ \s -> fmap (,s) m
+ liftIO m = GHCiQ $ \_ -> m
instance TH.Quasi GHCiQ where
qNewName str = ghcCmd (NewName str)
qReport isError msg = ghcCmd (Report isError msg)
-- See Note [TH recover with -fexternal-interpreter] in GHC.Tc.Gen.Splice
- qRecover (GHCiQ h) a = GHCiQ $ \s -> mask $ \unmask -> do
+ qRecover (GHCiQ h) a = GHCiQ $ \sRef -> mask $ \unmask -> do
+ s <- readIORef sRef
remoteTHCall (qsPipe s) StartRecover
- e <- try $ unmask $ runGHCiQ (a <* ghcCmd FailIfErrs) s
+ e <- try $ unmask $ runGHCiQ (a <* ghcCmd FailIfErrs) sRef
remoteTHCall (qsPipe s) (EndRecover (isLeft e))
case e of
- Left GHCiQException{} -> h s
+ Left GHCiQException{} -> h sRef
Right r -> return r
qLookupName isType occ = ghcCmd (LookupName isType occ)
qReify name = ghcCmd (Reify name)
@@ -200,15 +202,16 @@ instance TH.Quasi GHCiQ where
qAddTempFile suffix = ghcCmd (AddTempFile suffix)
qAddTopDecls decls = ghcCmd (AddTopDecls decls)
qAddForeignFilePath lang fp = ghcCmd (AddForeignFilePath lang fp)
- qAddModFinalizer fin = GHCiQ (\s -> mkRemoteRef fin >>= return . (, s)) >>=
+ qAddModFinalizer fin = GHCiQ (\_ -> mkRemoteRef fin) >>=
ghcCmd . AddModFinalizer
qAddCorePlugin str = ghcCmd (AddCorePlugin str)
- qGetQ = GHCiQ $ \s ->
+ qGetQ = do
+ s <- getState
let lookup :: forall a. Typeable a => Map TypeRep Dynamic -> Maybe a
lookup m = fromDynamic =<< M.lookup (typeOf (undefined::a)) m
- in return (lookup (qsMap s), s)
- qPutQ k = GHCiQ $ \s ->
- return ((), s { qsMap = M.insert (typeOf k) (toDyn k) (qsMap s) })
+ return $ lookup (qsMap s)
+ qPutQ k = GHCiQ $ \sRef ->
+ modifyIORef' sRef (\s -> s { qsMap = M.insert (typeOf k) (toDyn k) (qsMap s) })
qIsExtEnabled x = ghcCmd (IsExtEnabled x)
qExtsEnabled = ghcCmd ExtsEnabled
qPutDoc l s = ghcCmd (PutDoc l s)
@@ -231,7 +234,8 @@ runModFinalizerRefs pipe rstate qrefs = do
qs <- mapM localRef qrefs
qstateref <- localRef rstate
qstate <- readIORef qstateref
- _ <- runGHCiQ (TH.runQ $ sequence_ qs) qstate { qsPipe = pipe }
+ qstate' <- newIORef $ qstate { qsPipe = pipe }
+ _ <- runGHCiQ (TH.runQ $ sequence_ qs) qstate'
return ()
-- | The implementation of the 'RunTH' message
@@ -267,8 +271,6 @@ runTHQ
-> IO ByteString
runTHQ pipe rstate mb_loc ghciq = do
qstateref <- localRef rstate
- qstate <- readIORef qstateref
- let st = qstate { qsLocation = mb_loc, qsPipe = pipe }
- (r,new_state) <- runGHCiQ (TH.runQ ghciq) st
- writeIORef qstateref new_state
+ modifyIORef' qstateref (\qstate -> qstate { qsLocation = mb_loc, qsPipe = pipe })
+ r <- runGHCiQ (TH.runQ ghciq) qstateref
return $! LB.toStrict (runPut (put r))
=====================================
rts/IOManager.h
=====================================
@@ -21,6 +21,15 @@
#include "sm/GC.h" // for evac_fn
+#if defined(mingw32_HOST_OS)
+/* Global var (only on Windows) that is exported (hence before BeginPrivate.h)
+ * to be shared with the I/O code in the base library to tell us which style
+ * of I/O manager we are using: one that uses the Windows native API HANDLEs,
+ * or one that uses Posix style fds.
+ */
+extern bool rts_IOManagerIsWin32Native;
+#endif
+
#include "BeginPrivate.h"
/* The ./configure gives us a set of CPP flags, one for each named I/O manager:
@@ -160,14 +169,6 @@ typedef enum {
/* Global var to tell us which I/O manager impl we are using */
extern IOManagerType iomgr_type;
-#if defined(mingw32_HOST_OS)
-/* Global var (only on Windows) that is exported to be shared with the I/O code
- * in the base library to tell us which style of I/O manager we are using: one
- * that uses the Windows native API HANDLEs, or one that uses Posix style fds.
- */
-extern bool rts_IOManagerIsWin32Native;
-#endif
-
/* The CapIOManager is the per-capability data structure belonging to the I/O
* manager. It is defined in full in IOManagerInternals.h. The opaque forward
=====================================
rts/Linker.c
=====================================
@@ -478,16 +478,7 @@ initLinker_ (int retain_cafs)
symhash = allocStrHashTable();
/* populate the symbol table with stuff from the RTS */
- IF_DEBUG(linker, debugBelch("populating linker symbol table with built-in RTS symbols\n"));
- for (const RtsSymbolVal *sym = rtsSyms; sym->lbl != NULL; sym++) {
- IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr));
- if (! ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"),
- symhash, sym->lbl, sym->addr,
- sym->strength, sym->type, 0, NULL)) {
- barf("ghciInsertSymbolTable failed");
- }
- }
- IF_DEBUG(linker, debugBelch("done with built-in RTS symbols\n"));
+ initLinkerRtsSyms(symhash);
/* Add extra symbols. rtsExtraSyms() is a weakly defined symbol in the rts,
* that can be overrided by linking in an object with a corresponding
=====================================
rts/LinkerInternals.h
=====================================
@@ -502,4 +502,6 @@ ObjectCode* mkOc( ObjectType type, pathchar *path, char *image, int imageSize,
void initSegment(Segment *s, void *start, size_t size, SegmentProt prot, int n_sections);
void freeSegments(ObjectCode *oc);
+void initLinkerRtsSyms(StrHashTable *symhash);
+
#include "EndPrivate.h"
=====================================
rts/RtsSymbols.c
=====================================
@@ -9,6 +9,8 @@
#include "ghcplatform.h"
#include "Rts.h"
#include "RtsSymbols.h"
+#include "LinkerInternals.h"
+#include "PathUtils.h"
#include "TopHandler.h"
#include "HsFFI.h"
@@ -51,6 +53,20 @@ extern char **environ;
/* -----------------------------------------------------------------------------
* Symbols to be inserted into the RTS symbol table.
+ *
+ * Note [Naming Scheme for Symbol Macros]
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * SymI_*: symbol is internal to the RTS. It resides in an object
+ * file/library that is linked into the RTS library (as a static
+ * archive or dynamic shared library).
+ * SymE_*: symbol is external to the RTS library. It might be linked
+ * dynamically.
+ *
+ * Sym*_HasProto : the symbol prototype is imported in an include file
+ * or defined explicitly
+ * Sym*_NeedsProto: the symbol is undefined and we add a dummy
+ * default proto extern void sym(void);
*/
#define Maybe_Stable_Names SymI_HasProto(stg_mkWeakzh) \
@@ -162,7 +178,7 @@ extern char **environ;
SymI_HasProto(stg_asyncWritezh) \
SymI_HasProto(stg_asyncDoProczh) \
SymI_HasProto(rts_InstallConsoleEvent) \
- SymI_HasProto(rts_IOManagerIsWin32Native) \
+ SymI_HasDataProto(rts_IOManagerIsWin32Native) \
SymI_HasProto(rts_ConsoleHandlerDone) \
SymI_NeedsProto(__mingw_module_is_dll) \
RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \
@@ -524,7 +540,12 @@ extern char **environ;
SymI_HasProto(__word_encodeFloat) \
SymI_HasDataProto(stg_atomicallyzh) \
SymI_HasProto(barf) \
+ SymI_HasProto(startEventLogging) \
+ SymI_HasProto(endEventLogging) \
SymI_HasProto(flushEventLog) \
+ SymI_HasProto(flushEventLog) \
+ SymI_HasProto(getTraceFlag) \
+ SymI_HasProto(setTraceFlag) \
SymI_HasProto(deRefStablePtr) \
SymI_HasProto(debugBelch) \
SymI_HasProto(errorBelch) \
@@ -914,7 +935,7 @@ extern char **environ;
SymI_HasProto(freeExecPage) \
SymI_HasProto(getAllocations) \
SymI_HasProto(revertCAFs) \
- SymI_HasProto(RtsFlags) \
+ SymI_HasDataProto(RtsFlags) \
SymI_NeedsDataProto(rts_breakpoint_io_action) \
SymI_NeedsDataProto(rts_stop_next_breakpoint) \
SymI_NeedsDataProto(rts_stop_on_exception) \
@@ -925,9 +946,9 @@ extern char **environ;
SymI_NeedsProto(rts_enableStopAfterReturn) \
SymI_NeedsProto(rts_disableStopAfterReturn) \
SymI_HasProto(stopTimer) \
- SymI_HasProto(n_capabilities) \
- SymI_HasProto(max_n_capabilities) \
- SymI_HasProto(enabled_capabilities) \
+ SymI_HasDataProto(n_capabilities) \
+ SymI_HasDataProto(max_n_capabilities) \
+ SymI_HasDataProto(enabled_capabilities) \
SymI_HasDataProto(stg_traceEventzh) \
SymI_HasDataProto(stg_traceMarkerzh) \
SymI_HasDataProto(stg_traceBinaryEventzh) \
@@ -1145,12 +1166,27 @@ extern char **environ;
SymI_HasProto(hs_word2float64)
-/* entirely bogus claims about types of these symbols */
-#define SymI_NeedsProto(vvv) extern void vvv(void);
-#define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
-#define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv);
-#define SymE_NeedsDataProto(vvv) SymI_NeedsDataProto(vvv);
-#define SymE_HasProto(vvv) SymI_HasProto(vvv);
+/* Declare prototypes for the symbols that need it, so we can refer
+ * to them in the rtsSyms table below.
+ *
+ * In particular, for the external ones (SymE_*) we use the dllimport attribute
+ * to indicate that (on Windows) they come from external DLLs. This attribute
+ * is ignored on other platforms.
+ *
+ * The claims about the types of these symbols are entirely bogus.
+ */
+#if defined(mingw32_HOST_OS) && defined(DYNAMIC)
+#define DLLIMPORT __attribute__((dllimport))
+#else
+#define DLLIMPORT /**/
+#endif
+
+#define SymI_NeedsProto(vvv) extern void vvv(void);
+#define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
+#define SymE_NeedsProto(vvv) extern DLLIMPORT void vvv(void);
+#define SymE_NeedsDataProto(vvv) extern DLLIMPORT StgWord vvv[];
+
+#define SymE_HasProto(vvv) /**/
#define SymI_HasProto(vvv) /**/
#define SymI_HasDataProto(vvv) /**/
#define SymI_HasProto_redirect(vvv,xxx,strength,ty) /**/
@@ -1179,6 +1215,8 @@ RTS_SYMBOLS_PRIM
#undef SymE_NeedsProto
#undef SymE_NeedsDataProto
+/* See Note [Naming Scheme for Symbol Macros] */
+
#define SymI_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
(void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE },
#define SymI_HasDataProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
@@ -1199,7 +1237,16 @@ RTS_SYMBOLS_PRIM
{ MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
(void*)(&(xxx)), strength, ty },
-RtsSymbolVal rtsSyms[] = {
+
+
+/* Initialize (if not already initialized) and return an array of symbols with stuff from the RTS. */
+void initLinkerRtsSyms (StrHashTable *symhash) {
+ /* The address of data symbols with the dllimport attribute are not
+ * compile-time constants and so cannot be used in constant initialisers.
+ * For this reason, rtsSyms is a local variable within this function
+ * rather than a global constant (as it was historically).
+ */
+ const RtsSymbolVal rtsSyms[] = {
RTS_SYMBOLS
RTS_RET_SYMBOLS
RTS_POSIX_ONLY_SYMBOLS
@@ -1214,7 +1261,20 @@ RtsSymbolVal rtsSyms[] = {
RTS_SYMBOLS_PRIM
SymI_HasDataProto(nonmoving_write_barrier_enabled)
{ 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
-};
+ };
+
+ IF_DEBUG(linker, debugBelch("populating linker symbol table with built-in RTS symbols\n"));
+ for (const RtsSymbolVal *sym = rtsSyms; sym->lbl != NULL; sym++) {
+ IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr));
+ if (! ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"),
+ symhash, sym->lbl, sym->addr,
+ sym->strength, sym->type, 0, NULL)) {
+ barf("ghciInsertSymbolTable failed");
+ }
+ }
+ IF_DEBUG(linker, debugBelch("done with built-in RTS symbols\n"));
+}
+
// Note [Extra RTS symbols]
=====================================
rts/RtsSymbols.h
=====================================
@@ -46,8 +46,6 @@ typedef struct _RtsSymbolVal {
SymType type;
} RtsSymbolVal;
-extern RtsSymbolVal rtsSyms[];
-
extern RtsSymbolVal* __attribute__((weak)) rtsExtraSyms(void);
/* See Note [_iob_func symbol]. */
=====================================
rts/Trace.c
=====================================
@@ -29,14 +29,54 @@
#include <unistd.h>
#endif
-// events
-uint8_t TRACE_sched;
-uint8_t TRACE_gc;
-uint8_t TRACE_nonmoving_gc;
-uint8_t TRACE_spark_sampled;
-uint8_t TRACE_spark_full;
-uint8_t TRACE_user;
-uint8_t TRACE_cap;
+RUNTIME_TRACE_FLAG_CACHE RuntimeTraceFlagCache = {0};
+
+bool getTraceFlag(RUNTIME_TRACE_FLAG flag) {
+ switch (flag) {
+ case TRACE_SCHEDULER:
+ return RuntimeTraceFlagCache.scheduler;
+ case TRACE_GC:
+ return RuntimeTraceFlagCache.gc;
+ case TRACE_NONMOVING_GC:
+ return RuntimeTraceFlagCache.nonmoving_gc;
+ case TRACE_SPARK_SAMPLED:
+ return RuntimeTraceFlagCache.spark_sampled;
+ case TRACE_SPARK_FULL:
+ return RuntimeTraceFlagCache.spark_full;
+ case TRACE_USER:
+ return RuntimeTraceFlagCache.user;
+ case TRACE_CAP:
+ return RuntimeTraceFlagCache.cap;
+ default:
+ return false;
+ }
+}
+
+void setTraceFlag(RUNTIME_TRACE_FLAG flag, bool value) {
+ switch (flag) {
+ case TRACE_SCHEDULER:
+ RuntimeTraceFlagCache.scheduler = value;
+ break;
+ case TRACE_GC:
+ RuntimeTraceFlagCache.gc = value;
+ break;
+ case TRACE_NONMOVING_GC:
+ RuntimeTraceFlagCache.nonmoving_gc = value;
+ break;
+ case TRACE_SPARK_SAMPLED:
+ RuntimeTraceFlagCache.spark_sampled = value;
+ break;
+ case TRACE_SPARK_FULL:
+ RuntimeTraceFlagCache.spark_full = value;
+ break;
+ case TRACE_USER:
+ RuntimeTraceFlagCache.user = value;
+ break;
+ case TRACE_CAP:
+ RuntimeTraceFlagCache.cap = value;
+ break;
+ }
+}
#if defined(THREADED_RTS)
static Mutex trace_utx;
@@ -51,43 +91,41 @@ static void traceCap_stderr(Capability *cap, char *msg, ...);
--------------------------------------------------------------------------- */
/*
- * Update the TRACE_* globals. Must be called whenever RtsFlags.TraceFlags is
- * modified.
+ * Initialise the runtime trace flags from RtsFlags.TraceFlags.
*/
-static void updateTraceFlagCache (void)
-{
- // -Ds turns on scheduler tracing too
- TRACE_sched =
- RtsFlags.TraceFlags.scheduler ||
- RtsFlags.DebugFlags.scheduler;
-
- // -Dg turns on gc tracing too
- TRACE_gc =
- RtsFlags.TraceFlags.gc ||
- RtsFlags.DebugFlags.gc ||
- RtsFlags.DebugFlags.scheduler;
-
- TRACE_nonmoving_gc =
- RtsFlags.TraceFlags.nonmoving_gc;
-
- TRACE_spark_sampled =
- RtsFlags.TraceFlags.sparks_sampled;
-
- // -Dr turns on full spark tracing
- TRACE_spark_full =
- RtsFlags.TraceFlags.sparks_full ||
- RtsFlags.DebugFlags.sparks;
-
- TRACE_user =
- RtsFlags.TraceFlags.user;
-
- // We trace cap events if we're tracing anything else
- TRACE_cap =
- TRACE_sched ||
- TRACE_gc ||
- TRACE_spark_sampled ||
- TRACE_spark_full ||
- TRACE_user;
+static void updateTraceFlagCache(void) {
+ // -Ds turns on scheduler tracing too
+ RuntimeTraceFlagCache.scheduler =
+ RtsFlags.TraceFlags.scheduler ||
+ RtsFlags.DebugFlags.scheduler;
+
+ // -Dg turns on gc tracing too
+ RuntimeTraceFlagCache.gc =
+ RtsFlags.TraceFlags.gc ||
+ RtsFlags.DebugFlags.gc ||
+ RtsFlags.DebugFlags.scheduler;
+
+ RuntimeTraceFlagCache.nonmoving_gc =
+ RtsFlags.TraceFlags.nonmoving_gc;
+
+ RuntimeTraceFlagCache.spark_sampled =
+ RtsFlags.TraceFlags.sparks_sampled;
+
+ // -Dr turns on full spark tracing
+ RuntimeTraceFlagCache.spark_full =
+ RtsFlags.TraceFlags.sparks_full ||
+ RtsFlags.DebugFlags.sparks;
+
+ RuntimeTraceFlagCache.user =
+ RtsFlags.TraceFlags.user;
+
+ // We trace cap events if we're tracing anything else
+ RuntimeTraceFlagCache.cap =
+ TRACE_sched ||
+ TRACE_gc ||
+ TRACE_spark_sampled ||
+ TRACE_spark_full ||
+ TRACE_user;
}
void initTracing (void)
@@ -880,59 +918,65 @@ void traceThreadLabel_(Capability *cap,
}
}
-void traceConcMarkBegin(void)
+void traceNonmovingGcEvent_ (EventTypeNum tag)
{
- if (eventlog_enabled)
- postEventNoCap(EVENT_CONC_MARK_BEGIN);
+#if defined(DEBUG)
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ /* nothing - no string representation for nonmoving GC events */
+ } else
+#endif
+ {
+ /* currently most non-moving GC events are nullary events */
+ postEventNoCap(tag);
+ }
}
-void traceConcMarkEnd(StgWord32 marked_obj_count)
+void traceConcMarkEnd_(StgWord32 marked_obj_count)
{
- if (eventlog_enabled)
+#if defined(DEBUG)
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ /* nothing - no string representation for nonmoving GC events */
+ } else
+#endif
+ {
postConcMarkEnd(marked_obj_count);
+ }
}
-void traceConcSyncBegin(void)
-{
- if (eventlog_enabled)
- postEventNoCap(EVENT_CONC_SYNC_BEGIN);
-}
-
-void traceConcSyncEnd(void)
-{
- if (eventlog_enabled)
- postEventNoCap(EVENT_CONC_SYNC_END);
-}
-
-void traceConcSweepBegin(void)
-{
- if (eventlog_enabled)
- postEventNoCap(EVENT_CONC_SWEEP_BEGIN);
-}
-
-void traceConcSweepEnd(void)
-{
- if (eventlog_enabled)
- postEventNoCap(EVENT_CONC_SWEEP_END);
-}
-
-void traceConcUpdRemSetFlush(Capability *cap)
+void traceConcUpdRemSetFlush_(Capability *cap)
{
- if (eventlog_enabled)
+#if defined(DEBUG)
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ /* nothing - no string representation for nonmoving GC events */
+ } else
+#endif
+ {
postConcUpdRemSetFlush(cap);
+ }
}
-void traceNonmovingHeapCensus(uint16_t blk_size,
- const struct NonmovingAllocCensus *census)
+void traceNonmovingHeapCensus_(uint16_t blk_size, const struct NonmovingAllocCensus *census)
{
- if (eventlog_enabled && TRACE_nonmoving_gc)
+#if defined(DEBUG)
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ /* nothing - no string representation for nonmoving GC events */
+ } else
+#endif
+ {
postNonmovingHeapCensus(blk_size, census);
+ }
}
-void traceNonmovingPrunedSegments(uint32_t pruned_segments, uint32_t free_segments)
+void traceNonmovingPrunedSegments_(uint32_t pruned_segments, uint32_t free_segments)
{
- if (eventlog_enabled && TRACE_nonmoving_gc)
+#if defined(DEBUG)
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ /* nothing - no string representation for nonmoving GC events */
+ } else
+#endif
+ {
postNonmovingPrunedSegments(pruned_segments, free_segments);
+ }
}
void traceThreadStatus_ (StgTSO *tso USED_IF_DEBUG)
=====================================
rts/Trace.h
=====================================
@@ -70,16 +70,35 @@ enum CapsetType { CapsetTypeCustom = CAPSET_TYPE_CUSTOM,
#define DEBUG_continuation RtsFlags.DebugFlags.continuation
#define DEBUG_iomanager RtsFlags.DebugFlags.iomanager
-// Event-enabled flags
-// These semantically booleans but we use a dense packing to minimize their
-// cache impact.
-extern uint8_t TRACE_sched;
-extern uint8_t TRACE_gc;
-extern uint8_t TRACE_nonmoving_gc;
-extern uint8_t TRACE_spark_sampled;
-extern uint8_t TRACE_spark_full;
-extern uint8_t TRACE_cap;
-/* extern uint8_t TRACE_user; */ // only used in Trace.c
+// These trace flags are shorthand for the members of the RuntimeTraceFlagCache
+// struct. Within the RTS, these should be treated as read-only variables.
+#define TRACE_sched ((const bool)RuntimeTraceFlagCache.scheduler)
+#define TRACE_gc ((const bool)RuntimeTraceFlagCache.gc)
+#define TRACE_nonmoving_gc ((const bool)RuntimeTraceFlagCache.nonmoving_gc)
+#define TRACE_spark_sampled ((const bool)RuntimeTraceFlagCache.spark_sampled)
+#define TRACE_spark_full ((const bool)RuntimeTraceFlagCache.spark_full)
+#define TRACE_user ((const bool)RuntimeTraceFlagCache.user)
+#define TRACE_cap ((const bool)RuntimeTraceFlagCache.cap)
+
+/*
+ * Runtime trace flags.
+ */
+typedef struct {
+ bool scheduler;
+ bool gc;
+ bool nonmoving_gc;
+ bool spark_sampled;
+ bool spark_full;
+ bool user;
+ bool cap;
+} RUNTIME_TRACE_FLAG_CACHE;
+
+/*
+ * These flags should be used to determine whether or not some value should
+ * be traced at runtime, rather than the values in RtsFlags. These flags can
+ * be modified at runtime using setTraceFlag in `rts/EventLogWriter.h`.
+ */
+extern RUNTIME_TRACE_FLAG_CACHE RuntimeTraceFlagCache;
// -----------------------------------------------------------------------------
// Posting events
@@ -136,6 +155,52 @@ void traceGcEvent_ (Capability *cap, EventTypeNum tag);
void traceGcEventAtT_ (Capability *cap, StgWord64 ts, EventTypeNum tag);
+/*
+ * Record a nonmoving GC event.
+ */
+#define traceConcMarkBegin() \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingGcEvent_(EVENT_CONC_MARK_BEGIN); \
+ }
+#define traceConcMarkEnd(marked_obj_count) \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceConcMarkEnd_(marked_obj_count); \
+ }
+#define traceConcSyncBegin() \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingGcEvent_(EVENT_CONC_SYNC_BEGIN); \
+ }
+#define traceConcSyncEnd() \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingGcEvent_(EVENT_CONC_SYNC_END); \
+ }
+#define traceConcSweepBegin() \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingGcEvent_(EVENT_CONC_SWEEP_BEGIN); \
+ }
+#define traceConcSweepEnd() \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingGcEvent_(EVENT_CONC_SWEEP_END); \
+ }
+#define traceConcUpdRemSetFlush(cap) \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceConcUpdRemSetFlush_(cap); \
+ }
+#define traceNonmovingHeapCensus(blk_size, census) \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingHeapCensus_(blk_size, census); \
+ }
+#define traceNonmovingPrunedSegments(pruned_segments, free_segments) \
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc)) { \
+ traceNonmovingPrunedSegments_(pruned_segments, free_segments); \
+ }
+
+void traceNonmovingGcEvent_ (EventTypeNum tag);
+void traceConcMarkEnd_(StgWord32 marked_obj_count);
+void traceConcUpdRemSetFlush_(Capability *cap);
+void traceNonmovingHeapCensus_(uint16_t blk_size, const struct NonmovingAllocCensus *census);
+void traceNonmovingPrunedSegments_(uint32_t pruned_segments, uint32_t free_segments);
+
/*
* Record a heap event
*/
@@ -321,17 +386,6 @@ void traceProfSampleCostCentre(Capability *cap,
void traceProfBegin(void);
#endif /* PROFILING */
-void traceConcMarkBegin(void);
-void traceConcMarkEnd(StgWord32 marked_obj_count);
-void traceConcSyncBegin(void);
-void traceConcSyncEnd(void);
-void traceConcSweepBegin(void);
-void traceConcSweepEnd(void);
-void traceConcUpdRemSetFlush(Capability *cap);
-void traceNonmovingHeapCensus(uint16_t blk_size,
- const struct NonmovingAllocCensus *census);
-void traceNonmovingPrunedSegments(uint32_t pruned_segments, uint32_t free_segments);
-
void traceIPE(const InfoProvEnt *ipe);
void flushTrace(void);
@@ -384,6 +438,7 @@ void flushTrace(void);
#define traceConcSweepEnd() /* nothing */
#define traceConcUpdRemSetFlush(cap) /* nothing */
#define traceNonmovingHeapCensus(blk_size, census) /* nothing */
+#define traceNonmovingPrunedSegments(pruned_segments, free_segments) /* nothing */
#define flushTrace() /* nothing */
=====================================
rts/include/rts/EventLogWriter.h
=====================================
@@ -78,3 +78,34 @@ void endEventLogging(void);
* Flush the eventlog. cap can be NULL if one is not held.
*/
void flushEventLog(Capability **cap);
+
+/*
+ * An enumeration for the runtime trace flags.
+ */
+typedef enum {
+ TRACE_SCHEDULER,
+ TRACE_GC,
+ TRACE_NONMOVING_GC,
+ TRACE_SPARK_SAMPLED,
+ TRACE_SPARK_FULL,
+ TRACE_USER,
+ TRACE_CAP,
+} RUNTIME_TRACE_FLAG;
+
+/*
+ * Get the value of the given runtime trace flag.
+ *
+ * Warning: The trace flag cache is not thread-safe. After initialisation, the
+ * RTS never writes to these values, but concurrently using getTraceFlag and
+ * setTraceFlag for the same flag is a race condition.
+ */
+bool getTraceFlag(RUNTIME_TRACE_FLAG flag);
+
+/*
+ * Set the value of the given runtime trace flag.
+ *
+ * Warning: The trace flag cache is not thread-safe. After initialisation, the
+ * RTS never writes to these values. However, inconsistent reads may lead to
+ * incorrect tracing for a short time after setting a trace flag.
+ */
+void setTraceFlag(RUNTIME_TRACE_FLAG flag, bool value);
=====================================
rts/linker/Elf.c
=====================================
@@ -76,18 +76,6 @@
*
* See bug #781
* See thread http://www.haskell.org/pipermail/cvs-ghc/2007-September/038458.html
- *
- * Naming Scheme for Symbol Macros
- *
- * SymI_*: symbol is internal to the RTS. It resides in an object
- * file/library that is statically.
- * SymE_*: symbol is external to the RTS library. It might be linked
- * dynamically.
- *
- * Sym*_HasProto : the symbol prototype is imported in an include file
- * or defined explicitly
- * Sym*_NeedsProto: the symbol is undefined and we add a dummy
- * default proto extern void sym(void);
*/
#define X86_64_ELF_NONPIC_HACK (!RtsFlags.MiscFlags.linkerAlwaysPic)
=====================================
rts/sm/NonMoving.c
=====================================
@@ -1339,7 +1339,7 @@ concurrent_marking:
nonmovingPrintAllocatorCensus(!concurrent);
#endif
#if defined(TRACING)
- if (RtsFlags.TraceFlags.nonmoving_gc)
+ if (RTS_UNLIKELY(TRACE_nonmoving_gc))
nonmovingTraceAllocatorCensus();
#endif
=====================================
testsuite/tests/interface-stability/base-exports.stdout-ws-32 deleted
=====================================
The diff for this file was not included because it is too large.
=====================================
testsuite/tests/th/T27022.hs
=====================================
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+-- | This tests the behaviour of TH's recover method.
+-- It should behave the same in the internal and external interperter.
+-- In the past, they have diverged, and the external interpreter would roll back the state of putQ/getQ whereas the internal interpreter would not.
+module Main where
+
+import Language.Haskell.TH.Syntax
+main = print $(putQ "0" >> recover (pure ()) (putQ "42" >> fail "oops") >> getQ @String >>= lift )
=====================================
testsuite/tests/th/T27022.stdout
=====================================
@@ -0,0 +1 @@
+Just "42"
=====================================
testsuite/tests/th/all.T
=====================================
@@ -650,3 +650,4 @@ test('GadtConSigs_th_dump1', normal, compile, ['-v0 -ddump-splices -dsuppress-un
test('T26099', normal, compile_fail, [''])
test('T8306_th', only_ways(['ghci']), ghci_script, ['T8306_th.script'])
test('T26862_th', only_ways(['ghci']), ghci_script, ['T26862_th.script'])
+test('T27022', normal, compile_and_run, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bce22879b7d59320fbd3cbd2cb4918…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/bce22879b7d59320fbd3cbd2cb4918…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/sol/dont-use-global-variables] Don't use global variables to address concurrency bugs! (fixes #27234)
by Simon Hengel (@sol) 05 May '26
by Simon Hengel (@sol) 05 May '26
05 May '26
Simon Hengel pushed to branch wip/sol/dont-use-global-variables at Glasgow Haskell Compiler / GHC
Commits:
7d6e970a by Simon Hengel at 2026-05-06T01:55:17+07:00
Don't use global variables to address concurrency bugs! (fixes #27234)
This was originally introduce with
88f38b03025386f0f1e8f5861eed67d80495168a to address #17922.
In this specific case a better fix would have been to synchronize on
stderr:
withHandle_ "stderrSupportsAnsiColors" stderr $ \ _ -> do
...
But apparently the dependency on `terminfo` was removed in
32ab07bf3d6ce45e8ea5b55e8095174a6b42a7f0, preventing #17922 in the first
place.
- - - - -
4 changed files:
- + clean.sh
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/SysTools/Terminal.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
Changes:
=====================================
clean.sh
=====================================
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+set -o nounset
+set -o errexit
+
+dst=$(git describe --tags | sed s/-release//)
+
+rm -rf "$dst" "$dst.tar.gz"
+
+mkdir -p "$dst"
+find _build/stage1/ -name '*.hie' -print0 | xargs -0 cp --parents -t "$dst"
+
+rm -r "$dst/_build/stage1/utils/"
+rm -r "$dst/_build/stage1/ghc/"
+
+mv "$dst/_build/stage1/compiler/build" "$dst/ghc"
+
+find "$dst/_build/" -type d -name build | while read -r dir
+do
+ pkg=$(basename "$(dirname "$dir")")
+ mv "$dir" "$dst/$pkg"
+done
+
+rm -r "$dst/_build/"
+
+tar -czvf "$dst.tar.gz" "$dst"
+
+rm -rf "$dst"
=====================================
compiler/GHC/Driver/DynFlags.hs
=====================================
@@ -545,6 +545,7 @@ initDynFlags dflags = do
`catchIOError` \_ -> return False
ghcNoUnicodeEnv <- lookupEnv "GHC_NO_UNICODE"
let useUnicode' = isNothing ghcNoUnicodeEnv && canUseUnicode
+ canUseColor <- stderrSupportsAnsiColors
maybeGhcColorsEnv <- lookupEnv "GHC_COLORS"
maybeGhcColoursEnv <- lookupEnv "GHC_COLOURS"
let adjustCols (Just env) = Col.parseScheme env
@@ -556,9 +557,9 @@ initDynFlags dflags = do
return dflags{
useUnicode = useUnicode',
useColor = useColor',
- canUseColor = stderrSupportsAnsiColors,
+ canUseColor = canUseColor,
-- if the terminal supports color, we assume it supports links as well
- canUseErrorLinks = stderrSupportsAnsiColors,
+ canUseErrorLinks = canUseColor,
colScheme = colScheme',
tmpDir = TempDir tmp_dir
}
=====================================
compiler/GHC/SysTools/Terminal.hs
=====================================
@@ -14,17 +14,9 @@ import qualified Graphics.Win32 as Win32
import qualified System.Win32 as Win32
#endif
-import System.IO.Unsafe
-
--- | Does the controlling terminal support ANSI color sequences?
--- This memoized to avoid thread-safety issues in ncurses (see #17922).
-stderrSupportsAnsiColors :: Bool
-stderrSupportsAnsiColors = unsafePerformIO stderrSupportsAnsiColors'
-{-# NOINLINE stderrSupportsAnsiColors #-}
-
-- | Check if ANSI escape sequences can be used to control color in stderr.
-stderrSupportsAnsiColors' :: IO Bool
-stderrSupportsAnsiColors' = do
+stderrSupportsAnsiColors :: IO Bool
+stderrSupportsAnsiColors = do
#if !defined(mingw32_HOST_OS)
-- Equivalent of https://hackage.haskell.org/package/ansi-terminal/docs/System-Console-ANSI.…
isTerminal <- hIsTerminalDevice stderr
=====================================
libraries/ghc-internal/src/GHC/Internal/IO/Handle/Internals.hs
=====================================
@@ -143,8 +143,8 @@ original handle is always replaced.
{-# INLINE withHandle #-}
withHandle :: String -> Handle -> (Handle__ -> IO (Handle__,a)) -> IO a
-withHandle fun h@(FileHandle _ m) act = withHandle' fun h m act
-withHandle fun h@(DuplexHandle _ m _) act = withHandle' fun h m act
+withHandle fun h@(FileHandle _ m) = withHandle' fun h m
+withHandle fun h@(DuplexHandle _ m _) = withHandle' fun h m
withHandle' :: String -> Handle -> MVar Handle__
-> (Handle__ -> IO (Handle__,a)) -> IO a
@@ -157,8 +157,8 @@ withHandle' fun h m act =
{-# INLINE withHandle_ #-}
withHandle_ :: String -> Handle -> (Handle__ -> IO a) -> IO a
-withHandle_ fun h@(FileHandle _ m) act = withHandle_' fun h m act
-withHandle_ fun h@(DuplexHandle _ m _) act = withHandle_' fun h m act
+withHandle_ fun h@(FileHandle _ m) = withHandle_' fun h m
+withHandle_ fun h@(DuplexHandle _ m _) = withHandle_' fun h m
withHandle_' :: String -> Handle -> MVar Handle__ -> (Handle__ -> IO a) -> IO a
withHandle_' fun h m act = withHandle' fun h m $ \h_ -> do
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7d6e970a5905db346ef4851ed51e732…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7d6e970a5905db346ef4851ed51e732…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] 2 commits: ghci/TH: refactor to use IORef QState
by Marge Bot (@marge-bot) 05 May '26
by Marge Bot (@marge-bot) 05 May '26
05 May '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
96974723 by Teo Camarasu at 2026-05-05T14:45:20-04:00
ghci/TH: refactor to use IORef QState
This is a pure refactor and shouldn't modify semantics at all
- - - - -
eff6bfaf by Teo Camarasu at 2026-05-05T14:45:20-04:00
iserv: recover/getQ/putQ should behave same as internal interpreter
The internal and external interpreter should behave the same when
handling `recover`, the exeception recovery method of Q.
In practice, they diverge. In case of failure, the internal interpreter
only restores error message state to before the computation, wheras the
external interperter restores error message state *and* the state of putQ/getQ.
As far as I can tell this is a simple mistake in the implementation.
Note [TH recover with -fexternal-interpreter] describes the correct
behaviour but the implementation doesn't mirror this.
This change restores the correct behaviour by keeping the effects of
putQ in the erroring computation.
This is a breaking change since it modifies the behaviour of programs
that rely on recover ignoring putQ from failling computations when used
with the external interpreter. Although I highly doubt anyone relies on
this behaviour.
This divergence was first introduced in d00c308633fe7d216d31a1087e00e63532d87d6d.
As far as I can tell this was unintentional and tha commit was trying to solve a different bug.
Resolves #27022
- - - - -
5 changed files:
- + changelog.d/T27022
- libraries/ghci/GHCi/TH.hs
- + testsuite/tests/th/T27022.hs
- + testsuite/tests/th/T27022.stdout
- testsuite/tests/th/all.T
Changes:
=====================================
changelog.d/T27022
=====================================
@@ -0,0 +1,11 @@
+section: compiler
+synopsis: Fix a divergence in the interaction between ``recover`` and ``putQ`` between the internal and external interpreter
+description: The ``recover`` method in TemplateHaskell now behaves the same
+ with the internal and external interpreter.
+ In the past, when an error was encountered in a computation in a ``recover`` block,
+ the external interpreter would discard any state changes from ``putQ``,
+ whereas the internal interpreter would not.
+ This was a long-standing error in the implementation of the external interpreter.
+ Both now keep state changes from ``putQ`` in ``recover`` blocks.
+mrs: !15994
+issues: #27022
=====================================
libraries/ghci/GHCi/TH.hs
=====================================
@@ -119,7 +119,7 @@ initQState :: Pipe -> QState
initQState p = QState M.empty Nothing p
-- | The monad in which we run TH computations on the server
-newtype GHCiQ a = GHCiQ { runGHCiQ :: QState -> IO (a, QState) }
+newtype GHCiQ a = GHCiQ { runGHCiQ :: IORef QState -> IO a }
-- | The exception thrown by "fail" in the GHCiQ monad
data GHCiQException = GHCiQException QState String
@@ -128,52 +128,54 @@ data GHCiQException = GHCiQException QState String
instance Exception GHCiQException
instance Functor GHCiQ where
- fmap f (GHCiQ s) = GHCiQ $ fmap (\(x,s') -> (f x,s')) . s
+ fmap f (GHCiQ m) = GHCiQ $ fmap f . m
instance Applicative GHCiQ where
f <*> a = GHCiQ $ \s ->
- do (f',s') <- runGHCiQ f s
- (a',s'') <- runGHCiQ a s'
- return (f' a', s'')
- pure x = GHCiQ (\s -> return (x,s))
+ do f' <- runGHCiQ f s
+ a' <- runGHCiQ a s
+ return $ f' a'
+ pure x = GHCiQ $ \_ -> return x
instance Monad GHCiQ where
m >>= f = GHCiQ $ \s ->
- do (m', s') <- runGHCiQ m s
- (a, s'') <- runGHCiQ (f m') s'
- return (a, s'')
+ do m' <- runGHCiQ m s
+ a <- runGHCiQ (f m') s
+ return a
instance MonadFail GHCiQ where
- fail err = GHCiQ $ \s -> throwIO (GHCiQException s err)
+ fail err = GHCiQ $ \sRef -> readIORef sRef >>= \s -> throwIO (GHCiQException s err)
getState :: GHCiQ QState
-getState = GHCiQ $ \s -> return (s,s)
+getState = GHCiQ $ \sRef -> readIORef sRef
noLoc :: TH.Loc
noLoc = TH.Loc "<no file>" "<no package>" "<no module>" (0,0) (0,0)
-- | Send a 'THMessage' to GHC and return the result.
ghcCmd :: Binary a => THMessage (THResult a) -> GHCiQ a
-ghcCmd m = GHCiQ $ \s -> do
+ghcCmd m = GHCiQ $ \sRef -> do
+ s <- readIORef sRef
r <- remoteTHCall (qsPipe s) m
case r of
THException str -> throwIO (GHCiQException s str)
- THComplete res -> return (res, s)
+ THComplete res -> return res
instance MonadIO GHCiQ where
- liftIO m = GHCiQ $ \s -> fmap (,s) m
+ liftIO m = GHCiQ $ \_ -> m
instance TH.Quasi GHCiQ where
qNewName str = ghcCmd (NewName str)
qReport isError msg = ghcCmd (Report isError msg)
-- See Note [TH recover with -fexternal-interpreter] in GHC.Tc.Gen.Splice
- qRecover (GHCiQ h) a = GHCiQ $ \s -> mask $ \unmask -> do
+ qRecover (GHCiQ h) a = GHCiQ $ \sRef -> mask $ \unmask -> do
+ s <- readIORef sRef
remoteTHCall (qsPipe s) StartRecover
- e <- try $ unmask $ runGHCiQ (a <* ghcCmd FailIfErrs) s
+ e <- try $ unmask $ runGHCiQ (a <* ghcCmd FailIfErrs) sRef
remoteTHCall (qsPipe s) (EndRecover (isLeft e))
case e of
- Left GHCiQException{} -> h s
+ Left GHCiQException{} -> h sRef
Right r -> return r
qLookupName isType occ = ghcCmd (LookupName isType occ)
qReify name = ghcCmd (Reify name)
@@ -200,15 +202,16 @@ instance TH.Quasi GHCiQ where
qAddTempFile suffix = ghcCmd (AddTempFile suffix)
qAddTopDecls decls = ghcCmd (AddTopDecls decls)
qAddForeignFilePath lang fp = ghcCmd (AddForeignFilePath lang fp)
- qAddModFinalizer fin = GHCiQ (\s -> mkRemoteRef fin >>= return . (, s)) >>=
+ qAddModFinalizer fin = GHCiQ (\_ -> mkRemoteRef fin) >>=
ghcCmd . AddModFinalizer
qAddCorePlugin str = ghcCmd (AddCorePlugin str)
- qGetQ = GHCiQ $ \s ->
+ qGetQ = do
+ s <- getState
let lookup :: forall a. Typeable a => Map TypeRep Dynamic -> Maybe a
lookup m = fromDynamic =<< M.lookup (typeOf (undefined::a)) m
- in return (lookup (qsMap s), s)
- qPutQ k = GHCiQ $ \s ->
- return ((), s { qsMap = M.insert (typeOf k) (toDyn k) (qsMap s) })
+ return $ lookup (qsMap s)
+ qPutQ k = GHCiQ $ \sRef ->
+ modifyIORef' sRef (\s -> s { qsMap = M.insert (typeOf k) (toDyn k) (qsMap s) })
qIsExtEnabled x = ghcCmd (IsExtEnabled x)
qExtsEnabled = ghcCmd ExtsEnabled
qPutDoc l s = ghcCmd (PutDoc l s)
@@ -231,7 +234,8 @@ runModFinalizerRefs pipe rstate qrefs = do
qs <- mapM localRef qrefs
qstateref <- localRef rstate
qstate <- readIORef qstateref
- _ <- runGHCiQ (TH.runQ $ sequence_ qs) qstate { qsPipe = pipe }
+ qstate' <- newIORef $ qstate { qsPipe = pipe }
+ _ <- runGHCiQ (TH.runQ $ sequence_ qs) qstate'
return ()
-- | The implementation of the 'RunTH' message
@@ -267,8 +271,6 @@ runTHQ
-> IO ByteString
runTHQ pipe rstate mb_loc ghciq = do
qstateref <- localRef rstate
- qstate <- readIORef qstateref
- let st = qstate { qsLocation = mb_loc, qsPipe = pipe }
- (r,new_state) <- runGHCiQ (TH.runQ ghciq) st
- writeIORef qstateref new_state
+ modifyIORef' qstateref (\qstate -> qstate { qsLocation = mb_loc, qsPipe = pipe })
+ r <- runGHCiQ (TH.runQ ghciq) qstateref
return $! LB.toStrict (runPut (put r))
=====================================
testsuite/tests/th/T27022.hs
=====================================
@@ -0,0 +1,8 @@
+{-# LANGUAGE TemplateHaskell #-}
+-- | This tests the behaviour of TH's recover method.
+-- It should behave the same in the internal and external interperter.
+-- In the past, they have diverged, and the external interpreter would roll back the state of putQ/getQ whereas the internal interpreter would not.
+module Main where
+
+import Language.Haskell.TH.Syntax
+main = print $(putQ "0" >> recover (pure ()) (putQ "42" >> fail "oops") >> getQ @String >>= lift )
=====================================
testsuite/tests/th/T27022.stdout
=====================================
@@ -0,0 +1 @@
+Just "42"
=====================================
testsuite/tests/th/all.T
=====================================
@@ -650,3 +650,4 @@ test('GadtConSigs_th_dump1', normal, compile, ['-v0 -ddump-splices -dsuppress-un
test('T26099', normal, compile_fail, [''])
test('T8306_th', only_ways(['ghci']), ghci_script, ['T8306_th.script'])
test('T26862_th', only_ways(['ghci']), ghci_script, ['T26862_th.script'])
+test('T27022', normal, compile_and_run, [''])
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ff4fdb545703fba98b2b860b1b47d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8ff4fdb545703fba98b2b860b1b47d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][master] 3 commits: Use __attribute__((dllimport)) for external RTS symbol declarations
by Marge Bot (@marge-bot) 05 May '26
by Marge Bot (@marge-bot) 05 May '26
05 May '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
9a9ae4df by Duncan Coutts at 2026-05-05T14:44:37-04:00
Use __attribute__((dllimport)) for external RTS symbol declarations
This is needed to be hygenic about DLL symbol imports and exports.
The attribute is ignored on platforms other than Windows.
Use of the attribute however means that external data symbols do not
have a compile-time constant address (they are loaded using an
indirection). This means we have to adjust the rtsSyms initial linker
table so that it is a local constant in a function, rather than a global
constant. We now define it within a function that pre-populates the
symbol table with the RTS symbols.
- - - - -
2ad3e01e by Duncan Coutts at 2026-05-05T14:44:37-04:00
Fix the rts linker declarations for a few data symbols
and ensure that the (windows only) rts_IOManagerIsWin32Native data
symbol is marked as externally visible.
- - - - -
8ff4fdb5 by David Eichmann at 2026-05-05T14:44:37-04:00
Hadrian: Disable runtime pseudo relocations for RTS on windows hosts
- - - - -
7 changed files:
- hadrian/src/Settings/Packages.hs
- rts/IOManager.h
- rts/Linker.c
- rts/LinkerInternals.h
- rts/RtsSymbols.c
- rts/RtsSymbols.h
- rts/linker/Elf.c
Changes:
=====================================
hadrian/src/Settings/Packages.hs
=====================================
@@ -322,6 +322,7 @@ rtsPackageArgs = package rts ? do
, Profiling `wayUnit` way ? arg "-DPROFILING"
, Threaded `wayUnit` way ? arg "-DTHREADED_RTS"
, notM targetSupportsSMP ? arg "-optc-DNOSMP"
+ , isWinHost ? arg "-optl-Wl,--disable-runtime-pseudo-reloc"
-- See Note [AutoApply.cmm for vectors] in genapply/Main.hs
--
=====================================
rts/IOManager.h
=====================================
@@ -21,6 +21,15 @@
#include "sm/GC.h" // for evac_fn
+#if defined(mingw32_HOST_OS)
+/* Global var (only on Windows) that is exported (hence before BeginPrivate.h)
+ * to be shared with the I/O code in the base library to tell us which style
+ * of I/O manager we are using: one that uses the Windows native API HANDLEs,
+ * or one that uses Posix style fds.
+ */
+extern bool rts_IOManagerIsWin32Native;
+#endif
+
#include "BeginPrivate.h"
/* The ./configure gives us a set of CPP flags, one for each named I/O manager:
@@ -160,14 +169,6 @@ typedef enum {
/* Global var to tell us which I/O manager impl we are using */
extern IOManagerType iomgr_type;
-#if defined(mingw32_HOST_OS)
-/* Global var (only on Windows) that is exported to be shared with the I/O code
- * in the base library to tell us which style of I/O manager we are using: one
- * that uses the Windows native API HANDLEs, or one that uses Posix style fds.
- */
-extern bool rts_IOManagerIsWin32Native;
-#endif
-
/* The CapIOManager is the per-capability data structure belonging to the I/O
* manager. It is defined in full in IOManagerInternals.h. The opaque forward
=====================================
rts/Linker.c
=====================================
@@ -478,16 +478,7 @@ initLinker_ (int retain_cafs)
symhash = allocStrHashTable();
/* populate the symbol table with stuff from the RTS */
- IF_DEBUG(linker, debugBelch("populating linker symbol table with built-in RTS symbols\n"));
- for (const RtsSymbolVal *sym = rtsSyms; sym->lbl != NULL; sym++) {
- IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr));
- if (! ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"),
- symhash, sym->lbl, sym->addr,
- sym->strength, sym->type, 0, NULL)) {
- barf("ghciInsertSymbolTable failed");
- }
- }
- IF_DEBUG(linker, debugBelch("done with built-in RTS symbols\n"));
+ initLinkerRtsSyms(symhash);
/* Add extra symbols. rtsExtraSyms() is a weakly defined symbol in the rts,
* that can be overrided by linking in an object with a corresponding
=====================================
rts/LinkerInternals.h
=====================================
@@ -502,4 +502,6 @@ ObjectCode* mkOc( ObjectType type, pathchar *path, char *image, int imageSize,
void initSegment(Segment *s, void *start, size_t size, SegmentProt prot, int n_sections);
void freeSegments(ObjectCode *oc);
+void initLinkerRtsSyms(StrHashTable *symhash);
+
#include "EndPrivate.h"
=====================================
rts/RtsSymbols.c
=====================================
@@ -9,6 +9,8 @@
#include "ghcplatform.h"
#include "Rts.h"
#include "RtsSymbols.h"
+#include "LinkerInternals.h"
+#include "PathUtils.h"
#include "TopHandler.h"
#include "HsFFI.h"
@@ -51,6 +53,20 @@ extern char **environ;
/* -----------------------------------------------------------------------------
* Symbols to be inserted into the RTS symbol table.
+ *
+ * Note [Naming Scheme for Symbol Macros]
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *
+ * SymI_*: symbol is internal to the RTS. It resides in an object
+ * file/library that is linked into the RTS library (as a static
+ * archive or dynamic shared library).
+ * SymE_*: symbol is external to the RTS library. It might be linked
+ * dynamically.
+ *
+ * Sym*_HasProto : the symbol prototype is imported in an include file
+ * or defined explicitly
+ * Sym*_NeedsProto: the symbol is undefined and we add a dummy
+ * default proto extern void sym(void);
*/
#define Maybe_Stable_Names SymI_HasProto(stg_mkWeakzh) \
@@ -162,7 +178,7 @@ extern char **environ;
SymI_HasProto(stg_asyncWritezh) \
SymI_HasProto(stg_asyncDoProczh) \
SymI_HasProto(rts_InstallConsoleEvent) \
- SymI_HasProto(rts_IOManagerIsWin32Native) \
+ SymI_HasDataProto(rts_IOManagerIsWin32Native) \
SymI_HasProto(rts_ConsoleHandlerDone) \
SymI_NeedsProto(__mingw_module_is_dll) \
RTS_WIN64_ONLY(SymI_NeedsProto(___chkstk_ms)) \
@@ -914,7 +930,7 @@ extern char **environ;
SymI_HasProto(freeExecPage) \
SymI_HasProto(getAllocations) \
SymI_HasProto(revertCAFs) \
- SymI_HasProto(RtsFlags) \
+ SymI_HasDataProto(RtsFlags) \
SymI_NeedsDataProto(rts_breakpoint_io_action) \
SymI_NeedsDataProto(rts_stop_next_breakpoint) \
SymI_NeedsDataProto(rts_stop_on_exception) \
@@ -925,9 +941,9 @@ extern char **environ;
SymI_NeedsProto(rts_enableStopAfterReturn) \
SymI_NeedsProto(rts_disableStopAfterReturn) \
SymI_HasProto(stopTimer) \
- SymI_HasProto(n_capabilities) \
- SymI_HasProto(max_n_capabilities) \
- SymI_HasProto(enabled_capabilities) \
+ SymI_HasDataProto(n_capabilities) \
+ SymI_HasDataProto(max_n_capabilities) \
+ SymI_HasDataProto(enabled_capabilities) \
SymI_HasDataProto(stg_traceEventzh) \
SymI_HasDataProto(stg_traceMarkerzh) \
SymI_HasDataProto(stg_traceBinaryEventzh) \
@@ -1145,12 +1161,27 @@ extern char **environ;
SymI_HasProto(hs_word2float64)
-/* entirely bogus claims about types of these symbols */
-#define SymI_NeedsProto(vvv) extern void vvv(void);
-#define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
-#define SymE_NeedsProto(vvv) SymI_NeedsProto(vvv);
-#define SymE_NeedsDataProto(vvv) SymI_NeedsDataProto(vvv);
-#define SymE_HasProto(vvv) SymI_HasProto(vvv);
+/* Declare prototypes for the symbols that need it, so we can refer
+ * to them in the rtsSyms table below.
+ *
+ * In particular, for the external ones (SymE_*) we use the dllimport attribute
+ * to indicate that (on Windows) they come from external DLLs. This attribute
+ * is ignored on other platforms.
+ *
+ * The claims about the types of these symbols are entirely bogus.
+ */
+#if defined(mingw32_HOST_OS) && defined(DYNAMIC)
+#define DLLIMPORT __attribute__((dllimport))
+#else
+#define DLLIMPORT /**/
+#endif
+
+#define SymI_NeedsProto(vvv) extern void vvv(void);
+#define SymI_NeedsDataProto(vvv) extern StgWord vvv[];
+#define SymE_NeedsProto(vvv) extern DLLIMPORT void vvv(void);
+#define SymE_NeedsDataProto(vvv) extern DLLIMPORT StgWord vvv[];
+
+#define SymE_HasProto(vvv) /**/
#define SymI_HasProto(vvv) /**/
#define SymI_HasDataProto(vvv) /**/
#define SymI_HasProto_redirect(vvv,xxx,strength,ty) /**/
@@ -1179,6 +1210,8 @@ RTS_SYMBOLS_PRIM
#undef SymE_NeedsProto
#undef SymE_NeedsDataProto
+/* See Note [Naming Scheme for Symbol Macros] */
+
#define SymI_HasProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
(void*)(&(vvv)), STRENGTH_NORMAL, SYM_TYPE_CODE },
#define SymI_HasDataProto(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
@@ -1199,7 +1232,16 @@ RTS_SYMBOLS_PRIM
{ MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
(void*)(&(xxx)), strength, ty },
-RtsSymbolVal rtsSyms[] = {
+
+
+/* Initialize (if not already initialized) and return an array of symbols with stuff from the RTS. */
+void initLinkerRtsSyms (StrHashTable *symhash) {
+ /* The address of data symbols with the dllimport attribute are not
+ * compile-time constants and so cannot be used in constant initialisers.
+ * For this reason, rtsSyms is a local variable within this function
+ * rather than a global constant (as it was historically).
+ */
+ const RtsSymbolVal rtsSyms[] = {
RTS_SYMBOLS
RTS_RET_SYMBOLS
RTS_POSIX_ONLY_SYMBOLS
@@ -1214,7 +1256,20 @@ RtsSymbolVal rtsSyms[] = {
RTS_SYMBOLS_PRIM
SymI_HasDataProto(nonmoving_write_barrier_enabled)
{ 0, 0, STRENGTH_NORMAL, SYM_TYPE_CODE } /* sentinel */
-};
+ };
+
+ IF_DEBUG(linker, debugBelch("populating linker symbol table with built-in RTS symbols\n"));
+ for (const RtsSymbolVal *sym = rtsSyms; sym->lbl != NULL; sym++) {
+ IF_DEBUG(linker, debugBelch("initLinker: inserting rts symbol %s, %p\n", sym->lbl, sym->addr));
+ if (! ghciInsertSymbolTable(WSTR("(GHCi built-in symbols)"),
+ symhash, sym->lbl, sym->addr,
+ sym->strength, sym->type, 0, NULL)) {
+ barf("ghciInsertSymbolTable failed");
+ }
+ }
+ IF_DEBUG(linker, debugBelch("done with built-in RTS symbols\n"));
+}
+
// Note [Extra RTS symbols]
=====================================
rts/RtsSymbols.h
=====================================
@@ -46,8 +46,6 @@ typedef struct _RtsSymbolVal {
SymType type;
} RtsSymbolVal;
-extern RtsSymbolVal rtsSyms[];
-
extern RtsSymbolVal* __attribute__((weak)) rtsExtraSyms(void);
/* See Note [_iob_func symbol]. */
=====================================
rts/linker/Elf.c
=====================================
@@ -76,18 +76,6 @@
*
* See bug #781
* See thread http://www.haskell.org/pipermail/cvs-ghc/2007-September/038458.html
- *
- * Naming Scheme for Symbol Macros
- *
- * SymI_*: symbol is internal to the RTS. It resides in an object
- * file/library that is statically.
- * SymE_*: symbol is external to the RTS library. It might be linked
- * dynamically.
- *
- * Sym*_HasProto : the symbol prototype is imported in an include file
- * or defined explicitly
- * Sym*_NeedsProto: the symbol is undefined and we add a dummy
- * default proto extern void sym(void);
*/
#define X86_64_ELF_NONPIC_HACK (!RtsFlags.MiscFlags.linkerAlwaysPic)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3b75cccdd3fd27b1d2544f729ed62d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3b75cccdd3fd27b1d2544f729ed62d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/spj-reinstallable-base2] 11 commits: fixup krep fixes
by Rodrigo Mesquita (@alt-romes) 05 May '26
by Rodrigo Mesquita (@alt-romes) 05 May '26
05 May '26
Rodrigo Mesquita pushed to branch wip/spj-reinstallable-base2 at Glasgow Haskell Compiler / GHC
Commits:
9c334c51 by Rodrigo Mesquita at 2026-05-05T16:09:19+01:00
fixup krep fixes
TODO GET BACK
- - - - -
5f335b6e by Rodrigo Mesquita at 2026-05-05T16:09:25+01:00
Revert "fixup krep fixes"
This reverts commit 0c3177e9ecfdd9444df3439744996d599cb64c9b.
TODO GET BACK
- - - - -
9462a047 by Rodrigo Mesquita at 2026-05-05T16:09:28+01:00
Revert "krepStar, krepStarArrStar, etc..."
This reverts commit a47d441c70e2650cd7c6a4d466ec57c311ebe329.
TODO TODO TODO.
Thinking a bit more about this. get back later.
- - - - -
bf30dcb3 by Rodrigo Mesquita at 2026-05-05T16:27:07+01:00
emptyCallStack
- - - - -
f6e3662f by Rodrigo Mesquita at 2026-05-05T16:31:30+01:00
misc fixes to build
- - - - -
7f109c42 by Rodrigo Mesquita at 2026-05-05T16:55:20+01:00
callStackTyConKey, exceptionContextTyConKey, emptyExceptionContextName
- - - - -
d26b5b42 by Rodrigo Mesquita at 2026-05-05T17:10:49+01:00
errorMessageTypeErrorFamName, typeErrorTextDataConName, typeErrorAppendDataConName, typeErrorVAppendDataConName, typeErrorShowTypeDataConName
- - - - -
b7ce4338 by Rodrigo Mesquita at 2026-05-05T17:31:44+01:00
staticPtrTyConName, staticPtrDataConName, staticPtrInfoDataConName
- - - - -
7adf8b47 by Rodrigo Mesquita at 2026-05-05T17:31:44+01:00
-jsvalTyConName
- - - - -
e354bdae by Rodrigo Mesquita at 2026-05-05T17:31:44+01:00
knownNatClassName, knownSymbolClassName, knownCharClassName
- - - - -
a207cbcf by Rodrigo Mesquita at 2026-05-05T17:33:22+01:00
unsafeUnpackJSStringUtf8##
- - - - -
20 changed files:
- compiler/GHC/Builtin/KnownKeys.hs
- compiler/GHC/Builtin/KnownOccs.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Driver/Config/Tidy.hs
- compiler/GHC/Stg/BcPrep.hs
- compiler/GHC/StgToJS/Apply.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Types/Constraint.hs
- ghc/GHCi/UI.hs
- libraries/base/src/GHC/Essentials.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs-boot
- libraries/ghc-internal/src/GHC/Internal/JS/Prim.hs
- libraries/ghc-internal/src/GHC/Internal/Stack/Types.hs
- libraries/ghc-internal/src/GHC/Internal/Types.hs
Changes:
=====================================
compiler/GHC/Builtin/KnownKeys.hs
=====================================
@@ -253,10 +253,26 @@ knownKeyTable
-- Implicit Params
, (mkTcOcc "IP", ipClassKey)
+ -- Callstacks
+ , (mkVarOcc "CallStack", callStackTyConKey)
+
+ -- Exception context
+ , (mkVarOcc "ExceptionContext", exceptionContextTyConKey)
+
+ -- Custom type errors
+ , (mkTcOcc "TypeError", errorMessageTypeErrorFamKey)
+ , (mkDataOcc "Text", typeErrorTextDataConKey)
+ , (mkDataOcc ":<>:", typeErrorAppendDataConKey)
+ , (mkDataOcc ":$$:", typeErrorVAppendDataConKey)
+ , (mkDataOcc "ShowType", typeErrorShowTypeDataConKey)
+
-- Base strings Strings
, (mkVarOcc "unpackCString#", unpackCStringIdKey)
, (mkVarOcc "unpackCStringUtf8#", unpackCStringUtf8IdKey)
+ -- JS primitives
+ , (mkVarOcc "unsafeUnpackJSStringUtf8##", unsafeUnpackJSStringUtf8ShShKey)
+
-- Known-key names that have BuiltinRules in ConstantFold
, (mkVarOcc "unpackFoldrCString#", unpackCStringFoldrIdKey)
, (mkVarOcc "unpackFoldrCStringUtf8#", unpackCStringFoldrUtf8IdKey)
@@ -343,42 +359,22 @@ knownKeyTable
basicKnownKeyNames :: [Name] -- See Note [Known-key names]
basicKnownKeyNames
= [
+ -- KindReps for common cases
+ starKindRepName,
+ starArrStarKindRepName,
+ starArrStarArrStarKindRepName,
+ constraintKindRepName,
-- FFI primitive types that are not wired-in.
ptrTyConName, funPtrTyConName, constPtrConName,
int8TyConName, int16TyConName, int32TyConName, int64TyConName,
word8TyConName, word16TyConName, word32TyConName, word64TyConName,
- jsvalTyConName,
-
- -- Type-level naturals
- knownNatClassName, knownSymbolClassName, knownCharClassName,
-
- -- ExceptionContext
- exceptionContextTyConName,
- emptyExceptionContextName,
-
- -- Call Stacks
- callStackTyConName,
- emptyCallStackName,
-- Plugins
pluginTyConName
, frontendPluginTyConName
- -- StaticPtr
- , staticPtrTyConName
- , staticPtrDataConName, staticPtrInfoDataConName
-
- -- Custom type errors
- , errorMessageTypeErrorFamName
- , typeErrorTextDataConName
- , typeErrorAppendDataConName
- , typeErrorVAppendDataConName
- , typeErrorShowTypeDataConName
-
-- Unsafe coercion proofs
, unsafeCoercePrimName
-
- , unsafeUnpackJSStringUtf8ShShName
]
@@ -425,33 +421,21 @@ bniVarQual str key = varQual gHC_INTERNAL_NUM_INTEGER (fsLit str) key
-- End of ghc-bignum
---------------------------------
+
+-- Class Typeable, and functions for constructing `Typeable` dictionaries
+starKindRepName, starArrStarKindRepName,
+ starArrStarArrStarKindRepName, constraintKindRepName :: Name
+-- This is the Typeable 'Module' for GHC.Prim (which has no code, so we place in GHC.Types)
+-- See Note [Grand plan for Typeable] in GHC.Tc.Instance.Typeable.
+starKindRepName = varQual gHC_TYPES (fsLit "krep$*") starKindRepKey
+starArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*Arr*") starArrStarKindRepKey
+starArrStarArrStarKindRepName = varQual gHC_TYPES (fsLit "krep$*->*->*") starArrStarArrStarKindRepKey
+constraintKindRepName = varQual gHC_TYPES (fsLit "krep$Constraint") constraintKindRepKey
+
-- WithDict
withDictClassName :: Name
withDictClassName = clsQual gHC_MAGIC_DICT (fsLit "WithDict") withDictClassKey
--- Custom type errors
-errorMessageTypeErrorFamName
- , typeErrorTextDataConName
- , typeErrorAppendDataConName
- , typeErrorVAppendDataConName
- , typeErrorShowTypeDataConName
- :: Name
-
-errorMessageTypeErrorFamName =
- tcQual gHC_INTERNAL_TYPEERROR (fsLit "TypeError") errorMessageTypeErrorFamKey
-
-typeErrorTextDataConName =
- dcQual gHC_INTERNAL_TYPEERROR (fsLit "Text") typeErrorTextDataConKey
-
-typeErrorAppendDataConName =
- dcQual gHC_INTERNAL_TYPEERROR (fsLit ":<>:") typeErrorAppendDataConKey
-
-typeErrorVAppendDataConName =
- dcQual gHC_INTERNAL_TYPEERROR (fsLit ":$$:") typeErrorVAppendDataConKey
-
-typeErrorShowTypeDataConName =
- dcQual gHC_INTERNAL_TYPEERROR (fsLit "ShowType") typeErrorShowTypeDataConKey
-
-- Unsafe coercion proofs
unsafeCoercePrimName:: Name
unsafeCoercePrimName = varQual gHC_INTERNAL_UNSAFE_COERCE (fsLit "unsafeCoerce#") unsafeCoercePrimIdKey
@@ -478,28 +462,6 @@ ptrTyConName, funPtrTyConName :: Name
ptrTyConName = tcQual gHC_INTERNAL_PTR (fsLit "Ptr") ptrTyConKey
funPtrTyConName = tcQual gHC_INTERNAL_PTR (fsLit "FunPtr") funPtrTyConKey
--- Type-level naturals
-knownNatClassName :: Name
-knownNatClassName = clsQual gHC_INTERNAL_TYPENATS (fsLit "KnownNat") knownNatClassKey
-knownSymbolClassName :: Name
-knownSymbolClassName = clsQual gHC_INTERNAL_TYPELITS (fsLit "KnownSymbol") knownSymbolClassKey
-knownCharClassName :: Name
-knownCharClassName = clsQual gHC_INTERNAL_TYPELITS (fsLit "KnownChar") knownCharClassKey
-
--- ExceptionContext
-exceptionContextTyConName, emptyExceptionContextName :: Name
-exceptionContextTyConName =
- tcQual gHC_INTERNAL_EXCEPTION_CONTEXT (fsLit "ExceptionContext") exceptionContextTyConKey
-emptyExceptionContextName
- = varQual gHC_INTERNAL_EXCEPTION_CONTEXT (fsLit "emptyExceptionContext") emptyExceptionContextKey
-
--- Source Locations
-callStackTyConName, emptyCallStackName :: Name
-callStackTyConName
- = tcQual gHC_INTERNAL_STACK_TYPES (fsLit "CallStack") callStackTyConKey
-emptyCallStackName
- = varQual gHC_INTERNAL_STACK_TYPES (fsLit "emptyCallStack") emptyCallStackKey
-
-- plugins
pLUGINS :: Module
pLUGINS = mkThisGhcModule (fsLit "GHC.Driver.Plugins")
@@ -508,31 +470,10 @@ pluginTyConName = tcQual pLUGINS (fsLit "Plugin") pluginTyConKey
frontendPluginTyConName :: Name
frontendPluginTyConName = tcQual pLUGINS (fsLit "FrontendPlugin") frontendPluginTyConKey
-staticPtrInfoTyConName :: Name
-staticPtrInfoTyConName =
- tcQual gHC_INTERNAL_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoTyConKey
-
-staticPtrInfoDataConName :: Name
-staticPtrInfoDataConName =
- dcQual gHC_INTERNAL_STATICPTR (fsLit "StaticPtrInfo") staticPtrInfoDataConKey
-
-staticPtrTyConName :: Name
-staticPtrTyConName =
- tcQual gHC_INTERNAL_STATICPTR (fsLit "StaticPtr") staticPtrTyConKey
-
-staticPtrDataConName :: Name
-staticPtrDataConName =
- dcQual gHC_INTERNAL_STATICPTR (fsLit "StaticPtr") staticPtrDataConKey
-
constPtrConName :: Name
constPtrConName =
tcQual gHC_INTERNAL_FOREIGN_C_CONSTPTR (fsLit "ConstPtr") constPtrTyConKey
-jsvalTyConName :: Name
-jsvalTyConName = tcQual gHC_INTERNAL_WASM_PRIM_TYPES (fsLit "JSVal") jsvalTyConKey
-
-unsafeUnpackJSStringUtf8ShShName :: Name
-unsafeUnpackJSStringUtf8ShShName = varQual gHC_INTERNAL_JS_PRIM (fsLit "unsafeUnpackJSStringUtf8##") unsafeUnpackJSStringUtf8ShShKey
{-
************************************************************************
@@ -871,12 +812,6 @@ specTyConKey = mkPreludeTyConUnique 185
smallArrayPrimTyConKey = mkPreludeTyConUnique 187
smallMutableArrayPrimTyConKey = mkPreludeTyConUnique 188
-staticPtrTyConKey :: KnownKey
-staticPtrTyConKey = mkPreludeTyConUnique 189
-
-staticPtrInfoTyConKey :: KnownKey
-staticPtrInfoTyConKey = mkPreludeTyConUnique 190
-
callStackTyConKey :: KnownKey
callStackTyConKey = mkPreludeTyConUnique 191
@@ -1344,6 +1279,13 @@ typeCharTypeRepKey = mkPreludeMiscIdUnique 509
typeRepIdKey = mkPreludeMiscIdUnique 510
mkTrFunKey = mkPreludeMiscIdUnique 511
+-- KindReps for common cases
+starKindRepKey, starArrStarKindRepKey, starArrStarArrStarKindRepKey, constraintKindRepKey :: KnownKey
+starKindRepKey = mkPreludeMiscIdUnique 520
+starArrStarKindRepKey = mkPreludeMiscIdUnique 521
+starArrStarArrStarKindRepKey = mkPreludeMiscIdUnique 522
+constraintKindRepKey = mkPreludeMiscIdUnique 523
+
-- Dynamic
toDynIdKey :: KnownKey
toDynIdKey = mkPreludeMiscIdUnique 530
@@ -1362,18 +1304,12 @@ memptyClassOpKey = mkPreludeMiscIdUnique 555
mappendClassOpKey = mkPreludeMiscIdUnique 556
mconcatClassOpKey = mkPreludeMiscIdUnique 557
-emptyCallStackKey :: KnownKey
-emptyCallStackKey = mkPreludeMiscIdUnique 558
-
fromStaticPtrClassOpKey :: KnownKey
fromStaticPtrClassOpKey = mkPreludeMiscIdUnique 560
makeStaticKey :: KnownKey
makeStaticKey = mkPreludeMiscIdUnique 561
-emptyExceptionContextKey :: KnownKey
-emptyExceptionContextKey = mkPreludeMiscIdUnique 562
-
-- Unsafe coercion proofs
unsafeEqualityProofIdKey, unsafeCoercePrimIdKey :: KnownKey
unsafeEqualityProofIdKey = mkPreludeMiscIdUnique 570
=====================================
compiler/GHC/Builtin/KnownOccs.hs
=====================================
@@ -204,6 +204,16 @@ fromStaticPtrClassOpOcc, newStablePtrIdOcc :: KnownOcc
fromStaticPtrClassOpOcc = mkVarOcc "fromStaticPtr"
newStablePtrIdOcc = mkVarOcc "newStablePtr"
+staticPtrTyConOcc, staticPtrDataConOcc, staticPtrInfoDataConOcc :: KnownOcc
+staticPtrTyConOcc = mkTcOcc "StaticPtr"
+staticPtrDataConOcc = mkDataOcc "StaticPtr"
+staticPtrInfoDataConOcc = mkDataOcc "StaticPtrInfo"
+
+knownNatClassOcc, knownSymbolClassOcc, knownCharClassOcc :: KnownOcc
+knownNatClassOcc = mkTcOcc "KnownNat"
+knownSymbolClassOcc = mkTcOcc "KnownSymbol"
+knownCharClassOcc = mkTcOcc "KnownChar"
+
returnIOIdOcc, bindIOIdOcc, thenIOIdOcc,
printIdOcc, ioTyConOcc, ioDataConOcc :: KnownOcc
returnIOIdOcc = mkVarOcc "returnIO"
@@ -321,15 +331,6 @@ traceIdOcc = mkVarOcc "trace"
assertErrorIdOcc :: KnownOcc
assertErrorIdOcc = mkVarOcc "assertError"
--- KindReps for common cases
--- See Note [Grand plan for Typeable] (GPT6) in GHC.Tc.Instance.Typeable.
-starKindRepIdOcc, starArrStarKindRepIdOcc,
- starArrStarArrStarKindRepIdOcc, constraintKindRepIdOcc :: KnownOcc
-starKindRepIdOcc = mkVarOcc "krepStar"
-starArrStarKindRepIdOcc = mkVarOcc "krepArrStar"
-starArrStarArrStarKindRepIdOcc = mkVarOcc "krepStarArrStarArrStarKind"
-constraintKindRepIdOcc = mkVarOcc "krepConstraint"
-
-- ghci
ghciIoClassOcc, ghciStepIoMOcc :: KnownOcc
ghciIoClassOcc = mkTcOcc "GHCiSandboxIO"
@@ -340,9 +341,14 @@ toAnnotationWrapperIdOcc :: KnownOcc
toAnnotationWrapperIdOcc = mkVarOcc "toAnnotationWrapper"
-- CallStacks/Source locations
-pushCallStackIdOcc, srcLocDataConOcc :: KnownOcc
-pushCallStackIdOcc = mkVarOcc "pushCallStack"
-srcLocDataConOcc = mkDataOcc "SrcLoc"
+emptyCallStackIdOcc, pushCallStackIdOcc, srcLocDataConOcc :: KnownOcc
+emptyCallStackIdOcc = mkVarOcc "emptyCallStack"
+pushCallStackIdOcc = mkVarOcc "pushCallStack"
+srcLocDataConOcc = mkDataOcc "SrcLoc"
+
+-- ExceptionContext
+emptyExceptionContextIdOcc :: KnownOcc
+emptyExceptionContextIdOcc = mkVarOcc "emptyExceptionContext"
{- *********************************************************************
* *
=====================================
compiler/GHC/Core/Type.hs
=====================================
@@ -244,7 +244,7 @@ import {-# SOURCE #-} GHC.Builtin.WiredIn.Types
, manyDataConTy, oneDataConTy
, liftedRepTy, unliftedRepTy, zeroBitRepTy )
-import GHC.Types.Name( Name )
+import GHC.Types.Name( Name, hasKnownKey )
import GHC.Builtin.KnownKeys
import GHC.Core.Coercion.Axiom
@@ -1226,21 +1226,21 @@ pprUserTypeErrorTy ty =
-- Text "Something"
Just (tc,[txt])
- | tyConName tc == typeErrorTextDataConName
+ | tc `hasKnownKey` typeErrorTextDataConKey
, Just str <- isStrLitTy txt -> ftext str
-- ShowType t
Just (tc,[_k,t])
- | tyConName tc == typeErrorShowTypeDataConName -> ppr t
+ | tc `hasKnownKey` typeErrorShowTypeDataConKey -> ppr t
-- t1 :<>: t2
Just (tc,[t1,t2])
- | tyConName tc == typeErrorAppendDataConName ->
+ | tc `hasKnownKey` typeErrorAppendDataConKey ->
pprUserTypeErrorTy t1 <> pprUserTypeErrorTy t2
-- t1 :$$: t2
Just (tc,[t1,t2])
- | tyConName tc == typeErrorVAppendDataConName ->
+ | tc `hasKnownKey` typeErrorVAppendDataConKey ->
pprUserTypeErrorTy t1 $$ pprUserTypeErrorTy t2
-- An unevaluated type function
=====================================
compiler/GHC/Driver/Config/Tidy.hs
=====================================
@@ -17,7 +17,7 @@ import GHC.Driver.Backend
import GHC.Core.Make (getMkStringIds)
import GHC.Builtin.KnownKeys
-import GHC.Tc.Utils.Env (lookupGlobal, lookupKnownKeyGlobal)
+import GHC.Tc.Utils.Env (lookupKnownKeyGlobal)
import GHC.Types.TyThing
import GHC.Platform.Ways
@@ -48,8 +48,8 @@ initStaticPtrOpts hsc_env = do
let dflags = hsc_dflags hsc_env
mk_string <- getMkStringIds (fmap tyThingId . lookupKnownKeyGlobal hsc_env)
- static_ptr_info_datacon <- tyThingDataCon <$> lookupGlobal hsc_env staticPtrInfoDataConName
- static_ptr_datacon <- tyThingDataCon <$> lookupGlobal hsc_env staticPtrDataConName
+ static_ptr_info_datacon <- tyThingDataCon <$> lookupKnownKeyGlobal hsc_env staticPtrInfoDataConKey
+ static_ptr_datacon <- tyThingDataCon <$> lookupKnownKeyGlobal hsc_env staticPtrDataConKey
pure $ StaticPtrOpts
{ opt_platform = targetPlatform dflags
=====================================
compiler/GHC/Stg/BcPrep.hs
=====================================
@@ -14,7 +14,6 @@ module GHC.Stg.BcPrep ( bcPrep ) where
import GHC.Prelude
-import GHC.Types.Id.Make
import GHC.Types.Id
import GHC.Core.Type
=====================================
compiler/GHC/StgToJS/Apply.hs
=====================================
@@ -111,7 +111,7 @@ genApp ctx i args
-- We detect if the Id is unsafeUnpackJSStringUtf8## applied to a string literal,
-- if so then we convert the unsafeUnpack to a call to h$decode.
| [StgVarArg v] <- args
- , idName i == unsafeUnpackJSStringUtf8ShShName
+ , i `hasKnownKey` unsafeUnpackJSStringUtf8ShShKey
-- See: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10588
-- Comment by Josh Meredith <josh.meredith(a)iohk.io>
-- `typex_expr` can throw an error for certain bindings so it's important
@@ -122,7 +122,7 @@ genApp ctx i args
-- Test case T23479
| [StgLitArg (LitString bs)] <- args
, Just d <- decodeModifiedUTF8 bs
- , idName i == unsafeUnpackJSStringUtf8ShShName
+ , i `hasKnownKey` unsafeUnpackJSStringUtf8ShShKey
, [top] <- concatMap typex_expr (ctxTarget ctx)
= return . (,ExprInline) $ top |= toJExpr d
=====================================
compiler/GHC/Tc/Gen/Expr.hs
=====================================
@@ -629,7 +629,7 @@ tcExpr (HsStatic _ expr) res_ty
-- StaticPtr a -> p a
; fromStaticPtr <- newKnownOccMethod StaticOrigin
fromStaticPtrClassOpOcc [p_ty]
- ; static_ptr_ty_con <- tcLookupTyCon staticPtrTyConName
+ ; static_ptr_ty_con <- tcLookupKnownOccTyCon staticPtrTyConOcc
; let wrap = mkWpEvVarApps [typeable_ev] <.> mkWpTyApps [expr_ty]
static_expr_ty = mkTyConApp static_ptr_ty_con [expr_ty]
; return $ mkHsWrapCo co $
=====================================
compiler/GHC/Tc/Instance/Class.hs
=====================================
@@ -27,12 +27,13 @@ import GHC.Rename.Env( addUsedGRE, addUsedDataCons, DeprecationWarnings (..) )
import GHC.Builtin.WiredIn.Types
import GHC.Builtin.WiredIn.Prim
import GHC.Builtin.KnownKeys
+import GHC.Builtin.KnownOccs
import GHC.Builtin.PrimOps ( PrimOp(..) )
import GHC.Builtin.PrimOps.Ids ( primOpId )
import GHC.Types.FieldLabel
import GHC.Types.SafeHaskell
-import GHC.Types.Name ( Name )
+import GHC.Types.Name ( Name, KnownOcc )
import GHC.Types.Name.Reader
import GHC.Types.Var.Env ( VarEnv )
import GHC.Types.Id
@@ -960,9 +961,9 @@ matchTypeable clas [k,t] -- clas = Typeable
-- see Note [No Typeable for polytypes or qualified types]
-- Now cases that do work
- | k `eqType` naturalTy = doTyLit knownNatClassName t
- | k `eqType` typeSymbolKind = doTyLit knownSymbolClassName t
- | k `eqType` charTy = doTyLit knownCharClassName t
+ | k `eqType` naturalTy = doTyLit knownNatClassOcc t
+ | k `eqType` typeSymbolKind = doTyLit knownSymbolClassOcc t
+ | k `eqType` charTy = doTyLit knownCharClassOcc t
| Just (tc, ks) <- splitTyConApp_maybe t -- See Note [Typeable (T a b c)]
, onlyNamedBndrsApplied tc ks = doTyConApp clas t tc ks
@@ -1038,8 +1039,8 @@ mk_typeable_pred clas ty = mkClassPred clas [ typeKind ty, ty ]
-- Typeable is implied by KnownNat/KnownSymbol. In the case of a type literal
-- we generate a sub-goal for the appropriate class.
-- See Note [Typeable for Nat and Symbol]
-doTyLit :: Name -> Type -> TcM ClsInstResult
-doTyLit kc t = do { kc_clas <- tcLookupClass kc
+doTyLit :: KnownOcc -> Type -> TcM ClsInstResult
+doTyLit kc t = do { kc_clas <- tcLookupKnownOccClass kc
; let kc_pred = mkClassPred kc_clas [ t ]
mk_ev [ev] = evTypeable t $ EvTypeableTyLit (EvExpr ev)
mk_ev _ = panic "doTyLit"
=====================================
compiler/GHC/Tc/Instance/Typeable.hs
=====================================
@@ -22,6 +22,7 @@ import GHC.Tc.Utils.TcType
import GHC.Iface.Env( newGlobalBinder )
import GHC.Builtin.Modules( gHC_TYPES, gHC_PRIM )
+import GHC.Builtin.KnownKeys
import GHC.Builtin.KnownOccs
import GHC.Builtin.WiredIn.Prim ( primTyCons )
import GHC.Builtin.WiredIn.Types
@@ -136,15 +137,6 @@ There are many wrinkles:
KindReps once in GHC.Types. These are referred to as "built-in"
KindReps below.
- * When compiling GHC.Internal.Types, generate some extra bindings for
- built-in kindreps (see `todoForExportedKindReps`):
-
- krepStar = MkTyCon app ...
-
- * Re-export `krepStar` from GHC.Essentials.
- * In `mkTypeableBinds`, use `krepStar` directly rather than using its
- long form. Must use lookupKnownOcc to find it.
-
(GPT7) Even though KindReps aren't inlined, this scheme still has more of an
effect on compilation time than I'd like. This is especially true in
the case of families of type constructors (e.g. tuples and unboxed
@@ -471,12 +463,11 @@ todoForTyCons mod mod_id tycons = do
mod_fpr = fingerprintString $ moduleNameString $ moduleName mod
pkg_fpr = fingerprintString $ unitString $ moduleUnit mod
-todoForExportedKindReps :: [(Kind, KnownOcc)] -> TcM TypeRepTodo
+todoForExportedKindReps :: [(Kind, Name)] -> TcM TypeRepTodo
todoForExportedKindReps kinds = do
trKindRepTy <- mkTyConTy <$> tcLookupKnownOccTyCon kindRepTyConOcc
- names <- mapM (fmap idName . tcLookupKnownOccId . snd) kinds -- ROMES:TODO: ugh... I don't see how this would work. These bindings are defined dynamically here when compiling this module, so how would knownOcc find them? they aren't defined!
- let mkId k name = (k, mkExportedVanillaId name trKindRepTy)
- return $ ExportedKindRepsTodo $ zipWith mkId (map fst kinds) names
+ let mkId (k, name) = (k, mkExportedVanillaId name trKindRepTy)
+ return $ ExportedKindRepsTodo $ map mkId kinds
-- | Generate TyCon bindings for a set of type constructors
mkTypeRepTodoBinds :: [TypeRepTodo] -> TcM TcGblEnv
@@ -671,13 +662,13 @@ liftTc = KindRepM . lift
-- | We generate `KindRep`s for a few common kinds, so that they
-- can be reused across modules.
--- These definitions are generated in `GHC.Internal.Types`.
-builtInKindReps :: [(Kind, KnownOcc)]
+-- These definitions are generated in `ghc-prim:GHC.Types`.
+builtInKindReps :: [(Kind, Name)]
builtInKindReps =
- [ (star, starKindRepIdOcc)
- , (constraintKind, constraintKindRepIdOcc)
- , (mkVisFunTyMany star star, starArrStarKindRepIdOcc)
- , (mkVisFunTysMany [star, star] star, starArrStarArrStarKindRepIdOcc)
+ [ (star, starKindRepName)
+ , (constraintKind, constraintKindRepName)
+ , (mkVisFunTyMany star star, starArrStarKindRepName)
+ , (mkVisFunTysMany [star, star] star, starArrStarArrStarKindRepName)
]
where
star = liftedTypeKind
@@ -686,7 +677,7 @@ initialKindRepEnv :: TcRn KindRepEnv
initialKindRepEnv = foldlM add_kind_rep emptyTypeMap builtInKindReps
where
add_kind_rep acc (k,n) = do
- id <- tcLookupKnownOccId n
+ id <- tcLookupId n
return $! extendTypeMap acc k (id, Nothing)
-- The TypeMap looks through type synonyms
=====================================
compiler/GHC/Tc/Solver/Default.hs
=====================================
@@ -40,9 +40,10 @@ import GHC.Types.Unique.Set
import GHC.Types.Id
import GHC.Builtin
+import GHC.Builtin.KnownOccs ( emptyExceptionContextIdOcc )
import GHC.Builtin.KnownKeys( unsatisfiableIdKey
, isStringClassKey
- , emptyExceptionContextName )
+ )
import GHC.Builtin.Modules ( gHC_INTERNAL_TYPEERROR )
import GHC.Builtin.WiredIn.Types
import GHC.Builtin.WiredIn.Ids ( unboxedUnitExpr )
@@ -449,7 +450,7 @@ defaultExceptionContext ct
| ClassPred cls tys <- classifyPredType (ctPred ct)
, isJust (isExceptionContextPred cls tys)
= do { warnTcS $ TcRnDefaultedExceptionContext (ctLoc ct)
- ; empty_ec_id <- wrapTcS (TcM.tcLookupId emptyExceptionContextName)
+ ; empty_ec_id <- wrapTcS (TcM.tcLookupKnownOccId emptyExceptionContextIdOcc)
; let ev = ctEvidence ct
ev_tm = EvExpr (evWrapIPE (ctEvPred ev) (Var empty_ec_id))
; setDictIfWanted ev EvCanonical ev_tm
=====================================
compiler/GHC/Tc/Solver/Dict.hs
=====================================
@@ -45,8 +45,7 @@ import GHC.Types.Var.Set
import GHC.Types.Var.Env
import GHC.Types.SrcLoc
-import GHC.Builtin.KnownOccs( pushCallStackIdOcc, srcLocDataConOcc )
-import GHC.Builtin.KnownKeys( emptyCallStackName )
+import GHC.Builtin.KnownOccs( emptyCallStackIdOcc, pushCallStackIdOcc, srcLocDataConOcc )
import GHC.Utils.Monad ( concatMapM )
import GHC.Utils.Outputable
@@ -187,7 +186,7 @@ solveCallStack ev ev_cs
evCallStack :: TcPredType -> EvCallStack -> TcS EvExpr
-- See Note [Overview of implicit CallStacks] in GHC.Tc.Types.Evidence
evCallStack _ EvCsEmpty
- = Var <$> wrapTcS (tcLookupId emptyCallStackName)
+ = Var <$> wrapTcS (tcLookupKnownOccId emptyCallStackIdOcc)
evCallStack pred (EvCsPushCall fs loc tm)
= do { df <- getDynFlags
; m <- getModule
=====================================
compiler/GHC/Tc/Solver/Monad.hs
=====================================
@@ -136,7 +136,7 @@ import qualified GHC.Tc.Utils.Monad as TcM
import qualified GHC.Tc.Utils.TcMType as TcM
import qualified GHC.Tc.Instance.Class as TcM( matchGlobalInst, ClsInstResult(..) )
import qualified GHC.Tc.Utils.Env as TcM
- ( tcGetDefaultTys, tcLookupKnownKeyId, tcLookupTyCon )
+ ( tcGetDefaultTys, tcLookupKnownKeyId, tcLookupKnownKeyTyCon )
import GHC.Tc.Zonk.Monad ( ZonkM )
import qualified GHC.Tc.Zonk.TcType as TcM
@@ -159,7 +159,7 @@ import GHC.Tc.Types.Origin
import GHC.Tc.Types.CtLoc
import GHC.Tc.Types.Constraint
-import GHC.Builtin.KnownKeys ( callStackTyConName, exceptionContextTyConName )
+import GHC.Builtin.KnownKeys ( callStackTyConKey, exceptionContextTyConKey )
import GHC.Core.Make
import GHC.Core.Type
@@ -569,8 +569,8 @@ updSolvedDicts :: InstanceWhat -> DictCt -> TcS ()
updSolvedDicts what dict_ct@(DictCt { di_cls = cls, di_tys = tys, di_ev = ev })
| isWanted ev
, instanceReturnsDictCon what
- = do { is_callstack <- is_tyConTy isCallStackTy callStackTyConName
- ; is_exceptionCtx <- is_tyConTy isExceptionContextTy exceptionContextTyConName
+ = do { is_callstack <- is_tyConTy isCallStackTy callStackTyConKey
+ ; is_exceptionCtx <- is_tyConTy isExceptionContextTy exceptionContextTyConKey
; let contains_callstack_or_exceptionCtx =
mightMentionIP
(const True)
@@ -593,9 +593,9 @@ updSolvedDicts what dict_ct@(DictCt { di_cls = cls, di_tys = tys, di_ev = ev })
-- per Note [Using typesAreApart when calling mightMentionIP].
--
-- See Note [Using isCallStackTy in mightMentionIP].
- is_tyConTy :: (Type -> Bool) -> Name -> TcS (Type -> Bool)
- is_tyConTy is_eq tc_name
- = do { (mb_tc, _) <- wrapTcS $ TcM.tryTc $ TcM.tcLookupTyCon tc_name
+ is_tyConTy :: (Type -> Bool) -> KnownKey -> TcS (Type -> Bool)
+ is_tyConTy is_eq tc_key
+ = do { (mb_tc, _) <- wrapTcS $ TcM.tryTc $ TcM.tcLookupKnownKeyTyCon tc_key
; case mb_tc of
Just tc ->
return $ \ ty -> not (typesAreApart ty (mkTyConTy tc))
=====================================
compiler/GHC/Tc/Types/Constraint.hs
=====================================
@@ -1426,7 +1426,7 @@ userTypeError_maybe look_everywhere = go
| Just ty' <- coreView ty
= go ty'
go (TyConApp tc tys)
- | tyConName tc == errorMessageTypeErrorFamName
+ | tc `hasKnownKey` errorMessageTypeErrorFamKey
, _kind : msg : _ <- tys
-- There may be more than 2 arguments, if the type error is
-- used as a type constructor (e.g. at kind `Type -> Type`).
=====================================
ghc/GHCi/UI.hs
=====================================
@@ -78,9 +78,8 @@ import GHC.Types.SourceError ( SourceError, initSourceErrorContext )
import GHC.Types.Name
import GHC.Types.Var ( varType )
import GHC.Iface.Syntax ( showToHeader )
-import GHC.Builtin.KnownKeys( ghciStepIoMName )
-import GHC.Builtin.KnownOccs( ioTyConOcc, stringTyCon_RDR, compose_RDR )
-import GHC.Types.Name.Reader as RdrName ( getGRE_NameQualifier_maybes, getRdrName, greName, globalRdrEnvElts)
+import GHC.Builtin.KnownOccs( ghciStepIoMOcc, ioTyConOcc, stringTyCon_RDR, compose_RDR )
+import GHC.Types.Name.Reader as RdrName
import GHC.Types.SrcLoc as SrcLoc
import qualified GHC.Parser.Lexer as Lexer
import GHC.Parser.Header ( toArgs )
@@ -2011,7 +2010,7 @@ defineMacro overwrite s
let stringTy :: LHsType GhcPs
stringTy = nlHsTyVar NotPromoted stringTyCon_RDR
ioM :: LHsType GhcPs -- AZ
- ioM = nlHsTyVar NotPromoted (ExactOcc ioTyConOcc) `nlHsAppTy` stringTy
+ ioM = nlHsTyVar NotPromoted (Exact (ExactOcc ioTyConOcc)) `nlHsAppTy` stringTy
body = nlHsVar compose_RDR `mkHsApp` (nlHsPar step)
`mkHsApp` (nlHsPar expr)
tySig = mkHsWildCardBndrs $ noLocA $ mkHsImplicitSigType $
@@ -2081,8 +2080,8 @@ getGhciStepIO = do
ghciTyConName <- GHC.getGHCiMonad
let stringTy = nlHsTyVar NotPromoted stringTyCon_RDR
ghciM = nlHsTyVar NotPromoted (Exact ghciTyConName) `nlHsAppTy` stringTy
- ioM = nlHsTyVar NotPromoted (ExactOcc ioTyConOcc) `nlHsAppTy` stringTy
- body = nlHsVar (getRdrName ghciStepIoMName)
+ ioM = nlHsTyVar NotPromoted (Exact (ExactOcc ioTyConOcc)) `nlHsAppTy` stringTy
+ body = nlHsVar (Exact (ExactOcc ghciStepIoMOcc))
tySig = mkHsWildCardBndrs $ noLocA $ mkHsImplicitSigType $
nlHsFunTy ghciM ioM
return $ noLocA $ ExprWithTySig noAnn body tySig
=====================================
libraries/base/src/GHC/Essentials.hs
=====================================
@@ -126,11 +126,19 @@ module GHC.Essentials
-- WithDict
, WithDict
+ -- Type-level naturals/symbols/chars
+ , KnownNat, KnownSymbol, KnownChar
+
+ -- Custom type errors
+ , TypeError
+ , ErrorMessage(..)
+
-- Unsatisfiable
, Unsatisfiable, unsatisfiable
-- Static pointers
, IsStatic( fromStaticPtr ), makeStatic
+ , StaticPtr( StaticPtr ), StaticPtrInfo( StaticPtrInfo )
-- Stable pointers
, StablePtr, newStablePtr
@@ -149,6 +157,9 @@ module GHC.Essentials
, CS.unpackAppendCStringUtf8#, CS.cstringLength#
, eqString, inline
+ -- JS primitives
+ , unsafeUnpackJSStringUtf8##
+
, UnsafeEquality( UnsafeRefl ), unsafeEqualityProof
-- Typeable and type representations
@@ -216,16 +227,16 @@ module GHC.Essentials
, Body, normalB, guardedB
, Guard, normalGE, patGE
- -- See Note [Grand plan for Typeable] point (GPT6)
- , krepStar, krepArrStar
- , krepStarArrStarArrStarKind
- , krepConstraint
-
-- GHCi
, GHCiSandboxIO(ghciStepIO)
-- Callstacks
- , pushCallStack, SrcLoc(..)
+ , CallStack, emptyCallStack, pushCallStack, SrcLoc(..)
+
+ -- Exception context
+ , ExceptionContext, emptyExceptionContext
+
+ , toAnnotationWrapper
) where
import GHC.Internal.Base hiding( foldr )
@@ -236,6 +247,8 @@ import GHC.Internal.Real
import Data.String( IsString )
import GHC.Internal.Ix
import GHC.Internal.Magic.Dict( WithDict )
+import GHC.Internal.TypeNats( KnownNat )
+import GHC.Internal.TypeLits( KnownSymbol, KnownChar )
import GHC.Internal.Enum
import GHC.Internal.Data.Dynamic( toDyn )
import GHC.Internal.Data.Data
@@ -253,7 +266,7 @@ import GHC.Internal.Desugar( (>>>) ) -- See Note [Tricky known-occ cases]
import GHC.Internal.OverloadedLabels( fromLabel )
import GHC.Internal.Records
import GHC.Internal.CString as CS
-import GHC.Internal.TypeError( Unsatisfiable, unsatisfiable )
+import GHC.Internal.TypeError( TypeError, ErrorMessage(..), Unsatisfiable, unsatisfiable )
import GHC.Internal.System.IO( print )
import qualified GHC.Internal.IsList as IL
import GHC.Internal.Err( error )
@@ -263,7 +276,7 @@ import GHC.Internal.Word( Word8(W8#), Word16(W16#), Word32(W32#), Word64(W64#) )
import GHC.Internal.Unsafe.Coerce( UnsafeEquality(..), unsafeEqualityProof )
-import GHC.Internal.StaticPtr( IsStatic(..) )
+import GHC.Internal.StaticPtr( IsStatic(..), StaticPtr(..), StaticPtrInfo(..) )
import GHC.Internal.StaticPtr.Internal( makeStatic )
import GHC.Internal.Stable( StablePtr, newStablePtr )
@@ -280,7 +293,8 @@ import GHC.Internal.TH.Lib
import GHC.Internal.TH.Lift
import GHC.Internal.TH.Monad
import GHC.Internal.TopHandler
-import GHC.Internal.Classes.IP (IP)
import GHC.Internal.GHCi
import GHC.Internal.Desugar (toAnnotationWrapper)
import GHC.Internal.Stack.Types
+import GHC.Internal.Exception.Context
+import GHC.Internal.JS.Prim (unsafeUnpackJSStringUtf8##)
=====================================
libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs
=====================================
@@ -6,6 +6,7 @@
{-# LANGUAGE GADTs #-}
{-# OPTIONS_HADDOCK not-home #-}
+{-# OPTIONS_GHC -fdefines-known-key-names #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Internal.Exception.Context
=====================================
libraries/ghc-internal/src/GHC/Internal/Exception/Context.hs-boot
=====================================
@@ -1,4 +1,5 @@
{-# LANGUAGE NoImplicitPrelude #-}
+{-# OPTIONS_GHC -fdefines-known-key-names #-}
module GHC.Internal.Exception.Context where
=====================================
libraries/ghc-internal/src/GHC/Internal/JS/Prim.hs
=====================================
@@ -6,6 +6,8 @@
{-# LANGUAGE UnliftedFFITypes #-}
{-# LANGUAGE UnboxedTuples #-}
+{-# OPTIONS_GHC -fdefines-known-key-names #-}
+
module GHC.Internal.JS.Prim ( JSVal(..), JSVal#
, JSException(..)
, WouldBlockException(..)
=====================================
libraries/ghc-internal/src/GHC/Internal/Stack/Types.hs
=====================================
@@ -9,6 +9,7 @@
-- we hide this module from haddock to enforce GHC.Internal.Stack as the main
-- access point.
+{-# OPTIONS_GHC -fdefines-known-key-names #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Internal.Stack.Types
=====================================
libraries/ghc-internal/src/GHC/Internal/Types.hs
=====================================
@@ -8,7 +8,6 @@
-- NegativeLiterals: see Note [Fixity of (->)]
{-# OPTIONS_HADDOCK print-explicit-runtime-reps #-}
-{-# OPTIONS_GHC -frebindable-known-names #-} -- built-in type reps (e.g. krepStar) are defined in this module.
-----------------------------------------------------------------------------
-- |
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c8f3006f84841af96028cea4ee4cc9…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c8f3006f84841af96028cea4ee4cc9…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/dcoutts/windows-rts-dll] 5 commits: Add minimal dlltool support into ./configure
by David Eichmann (@DavidEichmann) 05 May '26
by David Eichmann (@DavidEichmann) 05 May '26
05 May '26
David Eichmann pushed to branch wip/dcoutts/windows-rts-dll at Glasgow Haskell Compiler / GHC
Commits:
68eff119 by Duncan Coutts at 2026-05-05T14:51:51+01:00
Add minimal dlltool support into ./configure
Find dlltool, and hopefully support finding it within the bundled llvm
toolchain on windows.
- - - - -
50192927 by Duncan Coutts at 2026-05-05T14:51:51+01:00
Update the default host and target files for dlltool support
- - - - -
0ef6450c by Duncan Coutts at 2026-05-05T14:51:51+01:00
Add dlltool as a hadrian builder
Optional except on windows.
- - - - -
95501811 by Duncan Coutts at 2026-05-05T14:51:51+01:00
Update and generate libHSghc-internal.def from .def.in file
The only symbol that the rts imports from the ghc-internal package now
is init_ghc_hs_iface. So the rts only needs an import lib that defines
that one symbol.
Also, remove the libHSghc-prim.def because it is redundant. The rts no
longer imports anything from ghc-prim.
Keep libHSffi.def for now. We may yet need it once it is clear how
libffi is going to be built/used for ghc.
- - - - -
fba86f1e by Duncan Coutts at 2026-05-05T14:51:51+01:00
Add rule to build libHSghc-internal.dll.a and link into the rts
On windows only, with dynamic linking.
This is needed because on windows, all symbols in dlls must be resolved.
No dangling symbols allowed. References to external symbols must be
explicit. We resolve this with an import library. We create an import
library for ghc-internal, a .dll.a file. This is a static archive
containing .o files that define the symbols we need, and crucially have
".idata" sections that specifies the symbols the dll imports and from
where.
Note that we do not install this libHSghc-internal.dll.a, and it does
not need to list all the symbols exported by that package. We create a
special purpose import lib and only use it when linking the rts dll, so
it only has to list the symbols that the rts uses from ghc-internal
(which is exactly one symbol: init_ghc_hs_iface).
- - - - -
15 changed files:
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- configure.ac
- distrib/configure.ac.in
- hadrian/cfg/default.host.target.in
- hadrian/cfg/default.target.in
- hadrian/src/Builder.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Library.hs
- hadrian/src/Rules/Rts.hs
- m4/fp_setup_windows_toolchain.m4
- m4/ghc_toolchain.m4
- m4/prep_target_file.m4
- rts/.gitignore
- + rts/win32/libHSghc-internal.def.in
Changes:
=====================================
.gitlab/generate-ci/gen_ci.hs
=====================================
@@ -1305,6 +1305,7 @@ cross_jobs = [
. setVariable "STRINGS" (llvm_prefix ++ "strings")
. setVariable "STRIP" (llvm_prefix ++ "strip")
. setVariable "WindresCmd" (llvm_prefix ++ "windres")
+ . setVariable "DlltoolCmd" (llvm_prefix ++ "llvm-dlltool")
. setVariable "LLVMAS" (llvm_prefix ++ "clang")
. setVariable "LD" (llvm_prefix ++ "ld")
-- Windows target require to make linker merge feature check disabled.
=====================================
.gitlab/jobs.yaml
=====================================
@@ -317,6 +317,7 @@
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "DlltoolCmd": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-dlltool",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -399,6 +400,7 @@
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "DlltoolCmd": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-dlltool",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -1111,6 +1113,7 @@
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "DlltoolCmd": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-dlltool",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
@@ -1194,6 +1197,7 @@
"CROSS_EMULATOR": "/opt/wine-arm64ec-msys2-deb12/bin/wine",
"CROSS_TARGET": "aarch64-unknown-mingw32",
"CXX": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-clang++",
+ "DlltoolCmd": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-llvm-dlltool",
"HADRIAN_ARGS": "--docs=none",
"INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check",
"LD": "/opt/llvm-mingw-linux/bin/aarch64-w64-mingw32-ld",
=====================================
configure.ac
=====================================
@@ -314,13 +314,16 @@ else
AC_CHECK_TOOL([RANLIB],[ranlib])
AC_CHECK_TOOL([OBJDUMP],[objdump])
AC_CHECK_TOOL([WindresCmd],[windres])
+ AC_CHECK_TOOL([DlltoolCmd],[llvm-dlltool])
AC_CHECK_TOOL([Genlib],[genlib])
if test "$HostOS" = "mingw32"; then
AC_CHECK_TARGET_TOOL([WindresCmd],[windres])
+ AC_CHECK_TARGET_TOOL([DlltoolCmd],[llvm-dlltool])
AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump])
WindresCmd="$(cygpath -m $WindresCmd)"
+ DlltoolCmd="$(cygpath -m $DlltoolCmd)"
if test "$Genlib" != ""; then
GenlibCmd="$(cygpath -m $Genlib)"
@@ -1080,9 +1083,10 @@ echo "\
libdw : $UseLibdw
Using LLVM tools
- llc : $LlcCmd
- opt : $OptCmd
- llvm-as : $LlvmAsCmd"
+ llc : $LlcCmd
+ opt : $OptCmd
+ llvm-as : $LlvmAsCmd
+ llvm-dlltool : $DlltoolCmd"
if test "$HSCOLOUR" = ""; then
echo "
=====================================
distrib/configure.ac.in
=====================================
@@ -229,6 +229,12 @@ FIND_LLVM_PROG([LLVMAS], [clang], [$LlvmMinVersion], [$LlvmMaxVersion])
LlvmAsCmd="$LLVMAS"
AC_SUBST([LlvmAsCmd])
+dnl ** Which LLVM llvm-dlltool to use?
+dnl --------------------------------------------------------------
+AC_ARG_VAR(DlltoolCmd,[Use as the path to LLVM's llvm-dlltool [default=autodetect]])
+FIND_LLVM_PROG([DlltoolCmd], [llvm-dlltool], [$LlvmMinVersion], [$LlvmMaxVersion])
+AC_SUBST([DlltoolCmd])
+
dnl We know that `clang` supports `--target` and it is necessary to pass it
dnl lest we see #25793.
if test -z "$LlvmAsFlags" && ! test -z "$LlvmTarget"; then
=====================================
hadrian/cfg/default.host.target.in
=====================================
@@ -45,6 +45,7 @@ Target
, tgtOpt = Nothing
, tgtLlvmAs = Nothing
, tgtWindres = Nothing
+, tgtDlltool = Nothing
, tgtOtool = Nothing
, tgtInstallNameTool = Nothing
}
=====================================
hadrian/cfg/default.target.in
=====================================
@@ -45,6 +45,7 @@ Target
, tgtOpt = @OptCmdMaybeProg@
, tgtLlvmAs = @LlvmAsCmdMaybeProg@
, tgtWindres = @WindresCmdMaybeProg@
+, tgtDlltool = @DlltoolCmdMaybeProg@
, tgtOtool = @OtoolCmdMaybeProg@
, tgtInstallNameTool = @InstallNameToolCmdMaybeProg@
}
=====================================
hadrian/src/Builder.hs
=====================================
@@ -17,7 +17,7 @@ import Development.Shake.Classes
import Development.Shake.Command
import Development.Shake.FilePath
import GHC.Generics
-import GHC.Platform.ArchOS (ArchOS(..), Arch(..))
+import GHC.Platform.ArchOS (ArchOS(..), Arch(..), OS(..))
import qualified Hadrian.Builder as H
import Hadrian.Builder hiding (Builder)
import Hadrian.Builder.Ar
@@ -180,6 +180,7 @@ data Builder = Alex
| Objdump
| Python
| Ranlib
+ | Dlltool
| Testsuite TestMode
| Sphinx SphinxMode
| Tar TarMode
@@ -418,6 +419,7 @@ isOptional target = \case
Alex -> True
-- Most ar implemententions no longer need ranlib, but some still do
Ranlib -> not $ Toolchain.arNeedsRanlib (tgtAr target)
+ Dlltool -> archOS_OS (tgtArchOs target) /= OSMinGW32
JsCpp -> not $ (archOS_arch . tgtArchOs) target == ArchJavaScript -- ArchWasm32 too?
_ -> False
@@ -442,6 +444,7 @@ systemBuilderPath builder = case builder of
Objdump -> fromKey "objdump"
Python -> fromKey "python"
Ranlib -> fromTargetTC "ranlib" (maybeProg Toolchain.ranlibProgram . tgtRanlib)
+ Dlltool -> fromTargetTC "dlltool" (maybeProg id . tgtDlltool)
Testsuite _ -> fromKey "python"
Sphinx _ -> fromKey "sphinx-build"
Tar _ -> fromKey "tar"
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -377,6 +377,7 @@ templateRules = do
, interpolateSetting "ProjectPatchLevel1" ProjectPatchLevel1
, interpolateSetting "ProjectPatchLevel2" ProjectPatchLevel2
]
+ templateRule "rts/win32/libHSghc-internal.def" projectVersion
templateRule "docs/index.html" $ packageUnitIds Stage1
templateRule "docs/users_guide/ghc_config.py" $ mconcat
[ projectVersion
=====================================
hadrian/src/Rules/Library.hs
=====================================
@@ -4,6 +4,8 @@ import Hadrian.BuildPath
import Hadrian.Haskell.Cabal
import Hadrian.Haskell.Cabal.Type
import qualified Text.Parsec as Parsec
+import GHC.Platform.ArchOS (ArchOS(archOS_OS), OS(..))
+import GHC.Toolchain.Target (Target(tgtArchOs))
import Base
import Context
@@ -185,9 +187,13 @@ jsObjects context = do
srcs <- interpretInContext context (getContextData jsSrcs)
mapM (objectPath context) srcs
--- | Return extra object files needed to build the given library context. The
--- resulting list is currently non-empty only when the package from the
--- 'Context' is @ghc-internal@ built with in-tree GMP backend.
+-- | Return extra object files needed to build the given library context.
+--
+-- This is non-empty for:
+--
+-- * @ghc-internal@ when built with in-tree GMP backend
+-- * @rts@ on Windows when linking dynamically
+--
extraObjects :: Context -> Action [FilePath]
extraObjects context
| package context == ghcInternal = do
@@ -195,6 +201,13 @@ extraObjects context
"gmp" -> gmpObjects (stage context)
_ -> return []
+ | package context == rts = do
+ target <- interpretInContext context getStagedTarget
+ builddir <- buildPath context
+ return [ builddir -/- "libHSghc-internal.dll.a"
+ | archOS_OS (tgtArchOs target) == OSMinGW32
+ , Dynamic `wayUnit` way context ]
+
| otherwise = return []
-- | Return all the object files to be put into the library we're building for
=====================================
hadrian/src/Rules/Rts.hs
=====================================
@@ -24,6 +24,20 @@ rtsRules = priority 3 $ do
(addRtsDummyVersion $ takeFileName rtsLibFilePath')
rtsLibFilePath'
+ -- Solve the recursive dependency between the rts and ghc-internal
+ -- on Windows by creating an import lib for the ghc-internal dll,
+ -- to be linked into the rts dll.
+ forM_ [Stage1, Stage2, Stage3 ] $ \ stage -> do
+ let buildPath = root -/- buildDir (rtsContext stage)
+ buildPath -/- "libHSghc-internal.dll.a" %> buildGhcInternalImportLib
+
+buildGhcInternalImportLib :: FilePath -> Action ()
+buildGhcInternalImportLib target = do
+ let input = "rts/win32/libHSghc-internal.def"
+ output = target -- the .dll.a import lib
+ need [input]
+ runBuilder Dlltool ["-d", input, "-l", output] [input] [output]
+
-- Need symlinks generated by rtsRules.
needRtsSymLinks :: Stage -> Set.Set Way -> Action ()
needRtsSymLinks stage rtsWays
=====================================
m4/fp_setup_windows_toolchain.m4
=====================================
@@ -131,8 +131,8 @@ AC_DEFUN([FP_SETUP_WINDOWS_TOOLCHAIN],[
AR="${mingwbin}llvm-ar.exe"
RANLIB="${mingwbin}llvm-ranlib.exe"
OBJDUMP="${mingwbin}llvm-objdump.exe"
- DLLTOOL="${mingwbin}llvm-dlltool.exe"
WindresCmd="${mingwbin}llvm-windres.exe"
+ DlltoolCmd="${mingwbin}llvm-dlltool.exe"
LLC="${mingwbin}llc.exe"
OPT="${mingwbin}opt.exe"
LLVMAS="${mingwbin}clang.exe"
=====================================
m4/ghc_toolchain.m4
=====================================
@@ -95,6 +95,7 @@ AC_DEFUN([FIND_GHC_TOOLCHAIN],
echo "--merge-objs=$MergeObjsCmd" >> acargs
echo "--readelf=$READELF" >> acargs
echo "--windres=$WindresCmd" >> acargs
+ echo "--dlltool=$DlltoolCmd" >> acargs
echo "--llc=$LlcCmd" >> acargs
echo "--opt=$OptCmd" >> acargs
echo "--llvm-as=$LlvmAsCmd" >> acargs
=====================================
m4/prep_target_file.m4
=====================================
@@ -191,6 +191,7 @@ AC_DEFUN([PREP_TARGET_FILE],[
PREP_MAYBE_SIMPLE_PROGRAM([OptCmd])
PREP_MAYBE_PROGRAM([LlvmAsCmd], [LlvmAsFlags])
PREP_MAYBE_SIMPLE_PROGRAM([WindresCmd])
+ PREP_MAYBE_SIMPLE_PROGRAM([DlltoolCmd])
PREP_MAYBE_SIMPLE_PROGRAM([OtoolCmd])
PREP_MAYBE_SIMPLE_PROGRAM([InstallNameToolCmd])
PREP_MAYBE_STRING([TargetVendor_CPP])
=====================================
rts/.gitignore
=====================================
@@ -20,3 +20,4 @@
/ghcautoconf.h.autoconf.in
/ghcautoconf.h.autoconf
/include/ghcautoconf.h
+/win32/libHSghc-internal.def
=====================================
rts/win32/libHSghc-internal.def.in
=====================================
@@ -0,0 +1,4 @@
+LIBRARY libHSghc-internal-@ProjectVersionForLib@.0-ghc@ProjectVersion@.dll
+
+EXPORTS
+ init_ghc_hs_iface
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3ece8f6c63c0b881cd18b4abc3ae8…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3ece8f6c63c0b881cd18b4abc3ae8…
You're receiving this email because of your account on gitlab.haskell.org.
1
0