You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We analyzed the [head.hackage](https://gitlab.haskell.org/ghc/head.hackage)[^head.hackage] patches to understand
10
+
Hi I'm [Jappie](https://jappie.me) and I volunteer for the [Haskell Foundation Stability Working Group](https://blog.haskell.org/stability-working-group/).
11
+
Recently we analyzed the [head.hackage](https://gitlab.haskell.org/ghc/head.hackage)[^head.hackage] patches to understand
11
12
why code breaks on new GHC releases.
12
13
"head.hackage" is a repository of patches for Hackage.
13
14
GHC engineers use these to test out new GHC builds on a wide range of
14
15
Hackage packages without having to upstream[^upstream] a patch, which can take time.
15
16
Instead, they can put the patch in "head.hackage"
16
17
and immediately test it on a wide range of packages.
17
18
Surprisingly, most breakage wasn’t caused by
18
-
Template Haskell—it came from deeper semantic changes in language extensions.
it came from deeper semantic changes in language extensions.
21
+
The meaning of (some) language extensions changed between GHC releases.
19
22
This post walks through the main categories of breakage,
20
23
why they happened, and what they tell us about long-term stability.
21
24
If you care about a smoother upgrade path for Haskell users,
22
25
we invite you to participate in the Stability Working Group.
23
26
24
27
[^upstream]: Upstreaming is the process of sending a patch to the “maintainers” of an open-source project. The maintainers will then make the patch ‘official’ by merging it. In principle, the process is simple, but in practice, the burden of proof (especially for larger projects) is on the person who submitted the patch. They have to convince the maintainers that the patch is useful, which takes time in the form of communication
25
28
26
-
The [Haskell Foundation Stability Working Group](https://blog.haskell.org/stability-working-group/)
27
-
is interested in understanding
28
-
why breakage occurs.
29
-
This is an extension of our initial [investigation](https://jappie.me/analyzing-haskell-stability.html).
30
-
We've recently done further analysis on [head.hackage](https://ghc.gitlab.haskell.org/head.hackage/),
We're also interested in understanding *why* breakage occurs.
31
+
So we've recently done further analysis on [head.hackage](https://ghc.gitlab.haskell.org/head.hackage/),
31
32
and learned surprisingly enough that the root cause
32
33
of a lot of breakage isn't Template Haskell,
33
34
but seems to be from language extension semantics[^meaning].
34
-
We're doing this investigation to better understand where the Haskell
35
-
Foundation stability working group should focus its efforts.
36
-
About a year ago I started on analyzing the causes
37
-
for all `head.hackage` patches, but I got bogged down
38
-
by the sheer amount of work.
39
-
Trevis suggested focusing on the
40
-
most important question,
41
-
why do language extension semantics cause so much breakage?
42
-
So instead of being bogged down by analyzing all
43
-
the patches, I just looked at the 12 patches from language extension
44
-
semantics.
35
+
We're doing this investigation to understand better where efforts
36
+
should be focused in improving stability.
45
37
46
38
[^meaning]: The precise meaning of features enabled by language extensions. I guess parser changes also count.
47
39
@@ -63,7 +55,7 @@ This gave us the following table:
63
55
`th-compat-0.1.4.patch` was miscounted so I left that out.
64
56
Simplified subsumption appears a lot but 3 are for Cabal,
65
57
so it's only 2 real occurrences.
66
-
We expect that to appear a lot however,
58
+
I'd expect that to appear a lot however,
67
59
because it was one of *the* motivating changes for a [stability working group](https://blog.haskell.org/stability-working-group/).
68
60
69
61
## Simplified subsumption
@@ -80,20 +72,22 @@ to do this under certain existential conditions:
80
72
+ (withLexicalCallStack (\x -> uncurry action x))
81
73
82
74
```
83
-
You've to insert a lambda, which apparently has some performance impact.
84
-
This went wild with[Yesod stacks](https://www.yesodweb.com/book),
75
+
You have to insert a lambda, which apparently has some performance impact.
76
+
This had a big impact on[Yesod stacks](https://www.yesodweb.com/book),
85
77
whose code generation helpfully created
86
78
the database alias in the template:
87
79
```diff
88
80
type DB a = forall (m :: Type -> Type).
89
81
(MonadUnliftIO m) => ReaderT SqlBackend m a
90
82
```
91
83
92
-
So anything that now uses a query has to insert those lambdas,
93
-
as you can imagine this would be in quite a few places for non-trivial commercial code bases.
94
-
Which caused many issues for commercial users.
95
-
You can just delete those aliases to solve the problem.
96
-
Alternatively you can just enable the language extension: [DeepSubsumption](https://downloads.haskell.org/~ghc/9.12.2/docs/users_guide/exts/rank_polymorphism.html#extension-DeepSubsumption).
84
+
Normally this is quite convenient,
85
+
however with the simplified subsumption change,
86
+
any code that interacts with the database now has to insert those lambdas.
87
+
As you can imagine this would in many places for a commercial code base.
88
+
Causing a lot of compile errors for industrial users.
89
+
Instead of inserting lambdas, you can also delete those existential aliases to solve the problem.
90
+
Or you can enable the language extension: [DeepSubsumption](https://downloads.haskell.org/~ghc/9.12.2/docs/users_guide/exts/rank_polymorphism.html#extension-DeepSubsumption).
97
91
Which restores the original behavior.
98
92
99
93
## Moving of instances due to Template Haskell
@@ -208,8 +202,8 @@ and as a concept is used for type-level programming type safety.
208
202
209
203
## Conclusion
210
204
211
-
Often we experience these breakages as annoying and frustrating.
212
-
However, if we look deeper, we find that each of them has
205
+
Often these breakages are annoying and frustrating.
206
+
But if we look deeper, we find that each of them has
0 commit comments